test.proto
enum FOO {
BAR = 1;
}
message AnotherOne {
.FOO list = 1;
}
> var messages = protobuf(fs.readFileSync('test.proto'))
Uncaught Error: Could not resolve .FOO
See https://developers.google.com/protocol-buffers/docs/proto#packages-and-name-resolution:
Type name resolution in the protocol buffer language works like C++: first the innermost scope is searched, then the next-innermost, and so on, with each package considered to be "inner" to its parent package. A leading '.' (for example, .foo.bar.Baz) means to start from the outermost scope instead.
test.proto
See https://developers.google.com/protocol-buffers/docs/proto#packages-and-name-resolution: