You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uncommenting any of the maps in the following file causes an error in the ts plugin:
$ cat bad.proto
syntax = "proto3";
message One {
//map<string, string> foo = 1;
//map<int32, int32> bar = 2;
//map<string, Two> baz = 3;
}
message Two {
}
Command and error output when the foo field is uncommented:
$ protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=. bad.proto
protoc-gen-ts error: Error: No message export for: One.FooEntry
at node_modules/ts-protoc-gen/lib/ts/message.js:57:23
at Array.forEach (native)
at Object.printMessage (node_modules/ts-protoc-gen/lib/ts/message.js:38:38)
at node_modules/ts-protoc-gen/lib/ts/fileDescriptorTSD.js:29:33
at Array.forEach (native)
at Object.printFileDescriptorTSD (node_modules/ts-protoc-gen/lib/ts/fileDescriptorTSD.js:28:41)
at node_modules/ts-protoc-gen/lib/ts_index.js:25:53
at Array.forEach (native)
at node_modules/ts-protoc-gen/lib/ts_index.js:21:48
at Socket.<anonymous> (node_modules/ts-protoc-gen/lib/util.js:61:9)
Error is equivalent for any of the other fields.
Adding a package statement to the proto definition fixes the error:
Uncommenting any of the maps in the following file causes an error in the ts plugin:
Command and error output when the
foo
field is uncommented:Error is equivalent for any of the other fields.
Adding a
package
statement to the proto definition fixes the error:Running it succeeds:
The text was updated successfully, but these errors were encountered: