-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The generated commonjs *_pb.js
files don't work in Node.js environment
#8
Comments
*_pb.js
files don't work in a Node.js environment*_pb.js
files don't work in Node.js environment
FYI, this was fixed in 3.19.x by PR #9156 in the old repo, but regressed to the old behavior. I've verified that this works with protoc version 3.19.4, but fails with 3.20.1. |
Any progress on this issue, running into the same problems. I'am not be able to compile an old version of libprotoc on apple silicon m2 arm64. Error using *_pb.js Thanks |
3.19.4 predates the split off of protobuf-javascript from the main protobuf repo. Do you still have a problem with protobuf v21+ (there was a numbering scheme change ~3.21) and the current published google-protobuf npm package/3.21 of protobuf-javascript? The main difference is you need to start specifying a --plugin flag to protoc to point it to protoc-gen-js. |
libprotoc 3.21.5
Error mentioned in #127 libprotoc 3.20.1 Any other ideas i could get the last working version of libprotoc 3.19.4 running on arm64? |
The surface level issue appears to be that it can't find protoc-gen-js on your PATH. However, I'm not familiar with either protoc-gen-ts or protoc-gen-grpc, so you may have better luck asking one of those projects how they depend on protoc-gen-js. |
We are forced to use 3.20.3 (where this bug is still present) because of #127,
at the start of our |
I'm seeing this same issue - can we re-open this issue? |
@tbarlow12 Can you please describe your setup and any reproduction instructions? |
We are also experiencing this issue when converting es module -> cjs via |
This bug is a rebirth of protocolbuffers/protobuf#9152, which has already been fixed in v3.19.1. It seems the fix hasn't been delivered to the latest version.
What version of protobuf and what language are you using?
Version: v3.20.1
Language: Javascript
What operating system (Linux, Windows, ...) and version?
macOs Monterey v12.3.1
What runtime / compiler are you using (e.g., python version or gcc version)
Node.js v16.13.0
What did you do?
protoc --js_out=import_style=commonjs,binary:path/to/out/dir --proto_path=. *.proto
What did you expect to see
Import and use without errors (just as in 3.19.1 - 3.19.4).
What did you see instead?
The text was updated successfully, but these errors were encountered: