Current Behavior
In projects that
Reproduction
bazel build ... and observe output:ERROR: error loading package 'MY_CLIENT_APP/client/node_modules/rxjs/src': Extension file not found. Unable to load package for '@build_bazel_rules_typescript//:defs.bzl': The repository could not be resolved
INFO: Elapsed time: 2.643s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded)
currently loading: MY_CLIENT_APP/client/node_modules/rxjs/src
Expected behavior
No error
Environment
$ bazel version
Build label: 0.13.0-homebrew
Possible Solution
Please have a release step that expunges or renames bazel files, or does some other trick, s.t. this problem does not occur when your module is brought into bazel projects.
Workaround only: doing local_repository() hacks in our WORKSPACE, or having a script that deletes the files as a hack.
cc @alexeagle
For people reading this and who would want a quick fix, you may add this to your WORKSPACE file:
local_repository(
name = "ignore_rxjs_module",
path = "./some_path/node_modules/rxjs/src",
)
Our plan is to stop including any bazel files in the distribution of rxjs.
To make rxjs work seamlessly with the bazel typescript rules, we should either:
In the meantime @IljaKroonen has the right workaround.
Note that starting in Bazel 0.18 (due to be released any day now) you can just put node_modules in your .bazelignore file, which is a much more robust long-term solution to any npm package shipping bazel files.
Most helpful comment
For people reading this and who would want a quick fix, you may add this to your WORKSPACE file: