We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using a package.json file within packages with "type":"module", a js_binary will error on startup:
"type":"module"
[Error [ERR_REQUIRE_ESM]: require() of ES Module /execroot/web/bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/tools/tw-k8s-deployment-pipeline/bin-packaged__js_binary.sh.runfiles/aspect_rules_js/js/private/node-patches/register.js not supported. register.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules. Instead rename register.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /execroot/web/bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/tools/tw-k8s-deployment-pipeline/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
Fix is probably to use the .cjs extension for register.js
Development (host) and target OS/architectures:
Output of bazel --version:
bazel --version
Version of the Aspect rules, or other relevant rules from your WORKSPACE or MODULE.bazel file:
WORKSPACE
MODULE.bazel
Language(s) and/or frameworks involved:
No response
The text was updated successfully, but these errors were encountered:
fix: use .cjs extension for fs patches
6704635
Fix aspect-build#1756
491c518
4d48034
8141090
e56f7e2
eff595b
jbedard
Successfully merging a pull request may close this issue.
What happened?
When using a package.json file within packages with
"type":"module"
, a js_binary will error on startup:Fix is probably to use the .cjs extension for register.js
Version
Development (host) and target OS/architectures:
Output of
bazel --version
:Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:Language(s) and/or frameworks involved:
How to reproduce
No response
Any other information?
No response
The text was updated successfully, but these errors were encountered: