Skip to content

Conversation

@ashwin153
Copy link

When I try to use web_assets with bzlmod I get the following error.

ERROR: error loading package under directory 'server/storyboard/ui': error loading package 'server/storyboard/ui': at /home/vscode/.cache/bazel/_bazel_vscode/7ad25f9ef7ff83782d7cbcac3c95dbb7/external/com_github_benchsci_rules_nodejs_gazelle+/defs.bzl:8:6: at /home/vscode/.cache/bazel/_bazel_vscode/7ad25f9ef7ff83782d7cbcac3c95dbb7/external/com_github_benchsci_rules_nodejs_gazelle+/internal/web_assets.bzl:6:6: Unable to find package for @@[unknown repo 'aspect_rules_js' requested from @@com_github_benchsci_rules_nodejs_gazelle+]//js:defs.bzl: The repository '@@[unknown repo 'aspect_rules_js' requested from @@com_github_benchsci_rules_nodejs_gazelle+]' could not be resolved: No repository visible as '@aspect_rules_js' from repository '@@com_github_benchsci_rules_nodejs_gazelle+'.

I get this error even when I add a dependency on aspect_rules_js to my MODULE.bazel. I think the root cause is a missing dependency on aspect_rules_js in this module, but I'm not a Bazel expert and might be mistaken. Let me know if this change will fix my problem.

When I try to use `web_assets` with `bzlmod` I get the following error.

```
ERROR: error loading package under directory 'server/storyboard/ui': error loading package 'server/storyboard/ui': at /home/vscode/.cache/bazel/_bazel_vscode/7ad25f9ef7ff83782d7cbcac3c95dbb7/external/com_github_benchsci_rules_nodejs_gazelle+/defs.bzl:8:6: at /home/vscode/.cache/bazel/_bazel_vscode/7ad25f9ef7ff83782d7cbcac3c95dbb7/external/com_github_benchsci_rules_nodejs_gazelle+/internal/web_assets.bzl:6:6: Unable to find package for @@[unknown repo 'aspect_rules_js' requested from @@com_github_benchsci_rules_nodejs_gazelle+]//js:defs.bzl: The repository '@@[unknown repo 'aspect_rules_js' requested from @@com_github_benchsci_rules_nodejs_gazelle+]' could not be resolved: No repository visible as '@aspect_rules_js' from repository '@@com_github_benchsci_rules_nodejs_gazelle+'.
```

I get this error even when I add a dependency on aspect_rules_js to my `MODULE.bazel`. I think the root cause is a missing dependency on `aspect_rules_js` in this module, but I'm not a Bazel expert and might be mistaken. Let me know if this change will fix my problem.
@ashwin153
Copy link
Author

@ColinHeathman does this look ok to you?

@KarolisL
Copy link

KarolisL commented Jan 5, 2026

@ashwin153 your patch solved my issue, thanks!

One can override the repo with:

bazel_dep(name = "com_github_benchsci_rules_nodejs_gazelle", version = "0.8.1")
archive_override(
    # Waiting for the PR to merge: https://github.com/benchsci/rules_nodejs_gazelle/pull/64
    module_name = "com_github_benchsci_rules_nodejs_gazelle",
    sha256 = "c7aeb7cb2aa8cdf25282a893ddd83e005ab38b7c41759e5ca8049054ff18055d",
    strip_prefix = "rules_nodejs_gazelle-e8ef2bb18d4289225f62a63a9e8151308a36b875",
    urls = ["https://github.com/ashwin153/rules_nodejs_gazelle/archive/e8ef2bb18d4289225f62a63a9e8151308a36b875.tar.gz"],
)

Although it migth be cleaner to apply a local patch using https://bazel.build/rules/lib/globals/module#single_version_override

Something like (untested):

single_version_override(
  module_name = "com_github_benchsci_rules_nodejs_gazelle",
  patches=["//some/where/in/the/repo:nodejs_gazelle.patch"],
  patch_strip=1,
)

Where //some/where/in/the/repo:nodejs_gazelle.patch is this file
https://github.com/ashwin153/rules_nodejs_gazelle/commit/e8ef2bb18d4289225f62a63a9e8151308a36b875.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants