Open thomasamills opened 5 years ago
What i did was to use commonJs version and do a
const bar = require(
The recent commits fixed this issue, however, some classes and names are now being duplicated.
Unrelated to my first post but fits within the scope of the issue name. Within the generation of the d.ts file, maps are not handled and the resulting js field types are defined as a list instead. I'm working on a fix now.
Hello,
Whilst using the protoc-gen-grpc-web plugin with --grpc-web_out set as: --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:
The resulting _pb.d.ts file contains class and namespace definitions of messages only in the top level of a message structure.
For example, with a message "Foo" in one file (foo.proto)
message Foo {
Bar b = 1 } message Bar { string msg = 1 }
And a service in a separate file (api.proto)
service API { // "Void" is an empty message rpc Run (Void) returns (Foo); }
The resulting api_pb.d.ts only contains class and namespace definitions for Foo and not Bar. However, if I were to nest Bar within Foo, it does generate the required class and namespaces.
Does anybody know how to fix this issue? Nesting each is not feasible as my message structures in my project are quite complex and messages re-used.