aspect-build / aspect-build/rules_js

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

Open
#2,524 0 comments 0 reactions 1 assignee Claimed by @jbedard View on GitHub
bug
Dominant language
Starlark
Stars
378
Forks
183
Avg merge
1d 9h
Merged PRs (30d)
32

Description

### 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

```shell
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.