[Bug]: buildifier_prebuilt declared as dev_dependency, yet used unconditionally
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Domain
- build-system
Research direction
Start with the top-level BUILD file and MODULE.bazel, then reproduce the failure with bazel query @rules_nodejs//:all-targets using rules_nodejs 6.7.3. Determine how the dev-only buildifier_prebuilt declaration conflicts with the unconditional load, and verify that a clean consumer repository can query the external targets successfully.
Written by the indexing model from the issue text.
Description
What happened?
Starting in 6.7.3, the rules_nodejs MODULE.bazel declares buildifier_prebuilt as a dev dependency.
However, the top-level BUILD file unconditionally load()s from @buildifier_prebuilt.
When I updated my repo to consume rules_nodejs 6.7.3, I discovered that I could not access the repo at all:
$ bazel query @rules_nodejs//:all-targets
[...]
(11:06:14) ERROR: error loading package '@@rules_nodejs+//': Unable to find package for @@[unknown repo 'buildifier_prebuilt' requested from @@rules_nodejs+]//:rules.bzl: The repository '@@[unknown repo 'buildifier_prebuilt' requested from @@rules_nodejs+]' could not be resolved: No repository visible as '@buildifier_prebuilt' from repository '@@rules_nodejs+'.
One way to work around this would be to simply delete the use of buildifier_prebuilt from this repo. I came up with a patch to do that.
I believe that another way would be to make buildifier_prebuilt not be a dev dependency.
I have no preference, but I think it would be good to resolve the impedance mismatch.
Version
Development (host) and target OS/architectures:
Ubuntu 24.04, amd64
Output of bazel --version:
8.3.1
Version of rules_nodejs, or other relevant rules from your
WORKSPACE or MODULE.bazel file:
6.7.3
Language(s) and/or frameworks involved:
How to reproduce
Create a repo with a MODULE.bazel as follows:
bazel_dep(name = "rules_nodejs", version = "6.7.3")`
Then try `bazel query @rules_nodejs//:all-targets`
Any other information?
No response
- Dominant language
- Starlark
- Stars
- 762
- Forks
- 531
- Avg merge
- 10h 31m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bazel-contrib/rules_nodejs
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
bazel-contrib/rules_nodejs#3928 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
bazel-contrib/rules_nodejs#3922 · 1 reaction ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 45/100
bazel-contrib/rules_nodejs#3877 · 1 reaction ·
-
bug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 30/100
bazel-contrib/rules_nodejs#3834 ·
-
bug need: investigation
Difficulty 4/5 3-5 days Newbie friendliness 52/100
bazel-contrib/rules_nodejs#3809 · 2 comments ·
All issues in bazel-contrib/rules_nodejs
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
agentic-workflows cascade-suspected
Difficulty 1/5 Under an hour Newbie friendliness 88/100