rules_js icon indicating copy to clipboard operation
rules_js copied to clipboard

[Bug]: nodejs_toolchains is hardcoded in js/private/js_image_layer.bzl

Open menny opened this issue 3 months ago • 0 comments

What happened?

Our setup does not include @nodejs_toolchains toolchain, we have various version-specific nodejs toolchain registered. As a result, any rules_js release 2.3.2 and onward fails with no such package '@@nodejs_toolchains//': The repository '@@nodejs_toolchains' could not be resolved: Repository '@@nodejs_toolchains' is not defined when using js_image_layer.

Version

Development (host) and target OS/architectures: macos + linux Output of bazel --version: 7.6.0 Version of the Aspect rules, or other relevant rules from your WORKSPACE or MODULE.bazel file: 2.3.2->2.8+ Language(s) and/or frameworks involved: js

How to reproduce

ensure you do not register the default `nodejs` toolchain with either `rules_js_register_toolchains` or `nodejs_register_toolchains`

Other toolschains' name are fine:
- `nodejs_register_toolchains(name = "nodejs25")` is fine in the repro
- `nodejs_register_toolchains(name = "nodejs")` is to be avoided in the repro

Any other information?

Could have been introduced in https://github.com/aspect-build/rules_js/pull/2142/files

menny avatar Nov 25 '25 13:11 menny