rxjs bazel files interact badly with containing bazel projects

Bug Report

Current Behavior
In projects that

  • use bazel
  • have client apps whose node_modules folder contains rxjs
    It is not possible to go “bazel build …” at the top level, because bazel gets confused by rxjs’ bazel files.

Reproduction

  1. Be in a folder, in a bazel workspace, above a client application that depends (perhaps indirectly) on rxjs
  2. Run 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.

1 possible answer(s) on “rxjs bazel files interact badly with containing bazel projects

  1. 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",
    )