Preemptive note: There are a ton of \"relative module was not found\" questions on Stackoverflow. I have looked through as many as I could find and they are not
Ok I think this is just a bug in protoc
. I was running it like this:
protoc -I=../../protos/ ../../protos/foo.proto --js_out=import_style=typescript:. --grpc-web_out=import_style=typescript,mode=grpcweb:.
That creates foo_pb.d.ts
but it should create foo_pb.js
too. In fact it creates separate files for each message - memory.js
and empty.js
. I "fixed" it by running this command:
protoc -I=../../protos/ ../../protos/foo.proto --js_out=import_style=commonjs,binary:. --grpc-web_out=import_style=typescript,mode=grpcweb:.
This then generated the foo_pb.js
file, and it also generates the foo_pb.d.ts
file. I know right, WTF?