Skip to content
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

Commonjs build doesn't work in NodeJS due to ReferenceError: window is not defined #12

Closed
danieleguido opened this issue Aug 13, 2023 · 2 comments · Fixed by #14
Closed

Comments

@danieleguido
Copy link
Contributor

As stated in protocolbuffers/protobuf#9152 there is a ReferenceError: window is not defined in PR #11

I have updated all the required libraries and the rollup configuration, but no luck. Any hints @theorm ?

The built doesn't work anymore for nodejs (I just need to add a TYPE_NAG btw...)

@danieleguido
Copy link
Contributor Author

danieleguido commented Aug 13, 2023

I tried the solution proposed of switching to commonjs_strict, but then all import (and tests) fail:

protoc --js_out=import_style=commonjs_strict:. my_proto_file.proto

@danieleguido
Copy link
Contributor Author

or a manual edit would be:

+var global = Function('return this')();
-var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant