Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in 1.6.0 module name mapping stopped working with tsc #1830

Closed
aherrmann opened this issue Apr 16, 2020 · 5 comments
Closed

Regression in 1.6.0 module name mapping stopped working with tsc #1830

aherrmann opened this issue Apr 16, 2020 · 5 comments

Comments

@aherrmann
Copy link
Member

🐞 bug report

Affected Rule

The issue is caused by the rule: tsc

Is this a regression?

Yes, the previous version in which this bug was not present was: 1.1.0

Description

We use tsc from @npm//typescript:index.bzl directly to compile TypeScript code. The motivation is to have tighter control of the compilation, in particular produce commonjs outputs. We use it to produce several publishable interdepending npm packages, to that end we set a custom module_name e.g. @my/lib and rely on rules_nodejs's module name remapping feature for imports of the form @my/lib to map to the correct files in the execroot.

With the update of rules_nodejs from 1.1.0 to 1.6.0 the module name remapping broke for these rules. I.e. imports of the form @my/lib no longer resolve the correct sources in the execroot and fail with

uselib.ts(1,21): error TS2307: Cannot find module '@my/lib'.

🔬 Minimal Reproduction

🔥 Exception or Error


$ bazel build //:uselib --define=VERBOSE_LOGS=1
DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//typescript:typescript__files
DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//typescript:typescript__nested_node_modules
DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//typescript:typescript__contents
DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//typescript:typescript
DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//typescript:typescript__nested_node_modules: {}
DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//typescript:typescript__contents: {}
DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//typescript:typescript__files: {}
DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//typescript:typescript: {}
DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for //mylib:mylib
INFO: Analyzed target //:uselib (4 packages loaded, 13 targets configured).
INFO: Found 1 target...
ERROR: /home/aj/tweag.io/da/bazel-projects/repro/nodejs_module_mapping/BUILD.bazel:21:1: Action uselib.js failed (Exit 2) tsc.sh failed: error executing command bazel-out/host/bin/external/npm/typescript/bin/tsc.sh --outDir bazel-out/k8-fastbuild/bin --project ./tsconfig.json --declaration ... (remaining 2 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
[link_node_modules.js] manifest file bazel-out/k8-fastbuild/bin/_uselib-tsc.module_mappings.json
[link_node_modules.js] manifest contents {
  "workspace": "repro",
  "bin": "bazel-out/k8-fastbuild/bin",
  "root": "npm/node_modules",
  "modules": {
    "repro": [
      "execroot",
      "bazel-out/k8-fastbuild/bin"
    ]
  }
}
[link_node_modules.js] startCwd /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/12/execroot/repro
[link_node_modules.js] isExecroot true
[link_node_modules.js] resolved node_modules root npm/node_modules to /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/12/execroot/repro/external/npm/node_modules
[link_node_modules.js] cwd /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/12/execroot/repro
[link_node_modules.js] symlink( node_modules -> /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/12/execroot/repro/external/npm/node_modules )
[link_node_modules.js] mapping hierarchy [{"name":"repro","link":["execroot","bazel-out/k8-fastbuild/bin"]}]
[link_node_modules.js] symlink( repro -> /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/12/execroot/repro/bazel-out/k8-fastbuild/bin )
bazel node patches enabled. root: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/12/execroot symlinks in this directory will not escape
uselib.ts(1,21): error TS2307: Cannot find module '@my/lib'.
Target //:uselib failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.525s, Critical Path: 1.77s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

🌍 Your Environment

Operating System:

  
Ubuntu 19.10
  

Output of bazel version:

  
$ bazel version
Bazelisk version: development
Build label: 2.1.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Feb 7 13:01:04 2020 (1581080464)
Build timestamp: 1581080464
Build timestamp as int: 1581080464
  

Rules_nodejs version:

(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)

  
1.6.0
  

Anything else relevant?

  • We write a custom rule to adorn the outputs of tsc with the module_name attribute that is picked up by the module name remapper of rules_nodejs 1.1.0.
    See aherrmann/repro_rules_nodejs_module_mapping@7761eff

  • For reference the same reproduction works with rules_nodejs 1.1.0.
    See aherrmann/repro_rules_nodejs_module_mapping@7761eff

    A successful build produces the following log
    
    $ bazel build //:uselib --define=VERBOSE_LOGS=1
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:17:9: [link_node_modules.bzl] target //mylib:mylib adding module mapping @my/lib: ["bin", "repro/mylib"]
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:17:9: [link_node_modules.bzl] Linking @my/lib: ["bin", "repro/mylib"]
    INFO: Analyzed target //:uselib (18 packages loaded, 225 targets configured).
    INFO: Found 1 target...
    INFO: From Action mylib/index.js:
    [link_node_modules.js] module manifest: workspace repro, bin bazel-out/k8-fastbuild/bin, root npm/node_modules with first-party packages
     { repro: [ 'bin', 'repro' ] }
    [link_node_modules.js] found legacy_external_runfiles, switching root to external/npm/node_modules
    [link_node_modules.js] resolved root npm/node_modules to external/npm/node_modules
    [link_node_modules.js] cwd /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/13/execroot/repro
    [link_node_modules.js] symlink( node_modules -> external/npm/node_modules )
    [link_node_modules.js] mapping hierarchy [{"name":"repro","link":["bin","repro"]}]
    [link_node_modules.js] symlink( repro -> /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/13/execroot/repro/bazel-out/k8-fastbuild/bin )
    bazel node patches enabled. root: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/13/execroot symlinks in this directory will not escape
    INFO: From Action uselib.js:
    [link_node_modules.js] module manifest: workspace repro, bin bazel-out/k8-fastbuild/bin, root npm/node_modules with first-party packages
     { repro: [ 'bin', 'repro' ], '@my/lib': [ 'bin', 'repro/mylib' ] }
    [link_node_modules.js] found legacy_external_runfiles, switching root to external/npm/node_modules
    [link_node_modules.js] resolved root npm/node_modules to external/npm/node_modules
    [link_node_modules.js] cwd /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/14/execroot/repro
    [link_node_modules.js] symlink( node_modules -> external/npm/node_modules )
    [link_node_modules.js] mapping hierarchy [{"name":"@my/lib","link":["bin","repro/mylib"]},{"name":"repro","link":["bin","repro"]}]
    [link_node_modules.js] symlink( repro -> /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/14/execroot/repro/bazel-out/k8-fastbuild/bin )
    [link_node_modules.js] mkdir( @my )
    [link_node_modules.js] symlink( @my/lib -> /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/14/execroot/repro/bazel-out/k8-fastbuild/bin/mylib )
    bazel node patches enabled. root: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/14/execroot symlinks in this directory will not escape
    Target //:uselib up-to-date:
      bazel-bin/uselib.js
      bazel-bin/uselib.d.ts
    INFO: Elapsed time: 9.186s, Critical Path: 3.78s
    INFO: 2 processes: 2 linux-sandbox.
    INFO: Build completed successfully, 9 total actions
    
  • rules_nodejs 1.6.0 introduces ts_project and the LinkablePackageInfo provider.
    Using these still leads to a failure to resolve @my/lib.
    See aherrmann/repro_rules_nodejs_module_mapping@90aa842

    A failing build produces the following log
    
    $ bazel build //:uselib --define=VERBOSE_LOGS=1
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//typescript:typescript__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//typescript:typescript__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//typescript:typescript__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//typescript:typescript__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//typescript:typescript__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//typescript:typescript: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/path:path__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/path:path__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/path:path__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/inquire:inquire__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//typescript:typescript__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//typescript:typescript
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/codegen:codegen__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/codegen:codegen__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/codegen:codegen__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/base64:base64__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//buffer-from:buffer-from__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/inquire:inquire__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//buffer-from:buffer-from__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/utf8:utf8__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/base64:base64__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/inquire:inquire__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//buffer-from:buffer-from__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//buffer-from:buffer-from__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/utf8:utf8__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/base64:base64__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//protobufjs:protobufjs__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/eventemitter:eventemitter__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//protobufjs:protobufjs__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//protobufjs:protobufjs__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//buffer-from:buffer-from__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/eventemitter:eventemitter__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/utf8:utf8__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@types/long:long__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/eventemitter:eventemitter__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@types/long:long__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@bazel/typescript:typescript__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@types/long:long__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@types/long:long__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//buffer-from:buffer-from__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/inquire:inquire__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//protobufjs:protobufjs__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@types/long:long__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/fetch:fetch__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/inquire:inquire__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/fetch:fetch__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@types/long:long__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/float:float__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/inquire:inquire__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//protobufjs:protobufjs__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//long:long__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/fetch:fetch__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//long:long__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//long:long__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//long:long__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//long:long__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/eventemitter:eventemitter__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//long:long__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/eventemitter:eventemitter__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/float:float__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//protobufjs:protobufjs__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/eventemitter:eventemitter__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/pool:pool__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/pool:pool__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/pool:pool__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/float:float__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//source-map-support:source-map-support__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/codegen:codegen__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/aspromise:aspromise__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@bazel/typescript:typescript__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/aspromise:aspromise__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/codegen:codegen__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/codegen:codegen__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@protobufjs/aspromise:aspromise__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/utf8:utf8__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//source-map:source-map__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/utf8:utf8__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//source-map:source-map__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//source-map:source-map__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//source-map-support:source-map-support__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@types/node:node__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@bazel/typescript:typescript__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/utf8:utf8__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//tslib:tslib__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//tslib:tslib__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@types/node:node__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//source-map-support:source-map-support__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/base64:base64__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/base64:base64__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//tslib:tslib__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/base64:base64__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@types/node:node__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//tsutils:tsutils__nested_node_modules
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//tslib:tslib__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/pool:pool__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@bazel/typescript:typescript__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/pool:pool__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/float:float__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//tsutils:tsutils__files
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//tslib:tslib__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/float:float__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//tslib:tslib__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/float:float__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/pool:pool__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/path:path__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/path:path__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//tsutils:tsutils__contents
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/aspromise:aspromise__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/linker/link_node_modules.bzl:19:9: [link_node_modules.bzl] No LinkablePackageInfo for @npm//@bazel/typescript:typescript
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//tsutils:tsutils__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/aspromise:aspromise__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@bazel/typescript:typescript__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/aspromise:aspromise__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/path:path__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//source-map:source-map__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//source-map:source-map__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//source-map:source-map__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/fetch:fetch__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/fetch:fetch__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@protobufjs/fetch:fetch__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//tsutils:tsutils__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//tsutils:tsutils__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@types/node:node__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//source-map-support:source-map-support__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@bazel/typescript:typescript__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@types/node:node__files: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//source-map-support:source-map-support__nested_node_modules: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@types/node:node__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//source-map-support:source-map-support__contents: {}
    DEBUG: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/external/build_bazel_rules_nodejs/internal/common/module_mappings.bzl:41:9: [module_mappings.bzl] Mappings at @npm//@bazel/typescript:typescript: {}
    INFO: Analyzed target //:uselib (39 packages loaded, 714 targets configured).
    INFO: Found 1 target...
    ERROR: /home/aj/tweag.io/da/bazel-projects/repro/nodejs_module_mapping/BUILD.bazel:32:1: Compiling TypeScript project tsconfig.json failed (Exit 2) tsc.sh failed: error executing command bazel-out/host/bin/external/npm/typescript/bin/tsc.sh --project tsconfig.json --outDir bazel-out/k8-fastbuild/bin/ --rootDir . --listFiles --listEmittedFiles --traceResolution --diagnostics ... (remaining 3 argument(s) skipped)
    

    Use --sandbox_debug to see verbose messages from the sandbox
    [link_node_modules.js] manifest file bazel-out/k8-fastbuild/bin/_uselib-project.module_mappings.json
    [link_node_modules.js] manifest contents {
    "workspace": "repro",
    "bin": "bazel-out/k8-fastbuild/bin",
    "root": "npm/node_modules",
    "modules": {
    "repro": [
    "execroot",
    "bazel-out/k8-fastbuild/bin"
    ]
    }
    }
    [link_node_modules.js] startCwd /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro
    [link_node_modules.js] isExecroot true
    [link_node_modules.js] resolved node_modules root npm/node_modules to /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/external/npm/node_modules
    [link_node_modules.js] cwd /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro
    [link_node_modules.js] symlink( node_modules -> /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/external/npm/node_modules )
    [link_node_modules.js] mapping hierarchy [{"name":"repro","link":["execroot","bazel-out/k8-fastbuild/bin"]}]
    [link_node_modules.js] symlink( repro -> /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/bazel-out/k8-fastbuild/bin )
    bazel node patches enabled. root: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot symlinks in this directory will not escape
    ======== Resolving module '@my/lib' from '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/uselib.ts'. ========
    Module resolution kind is not specified, using 'NodeJs'.
    Loading module '@my/lib' from 'node_modules' folder, target file type 'TypeScript'.
    Directory '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/@types' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Directory '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/node_modules' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Directory '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/node_modules' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Directory '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/node_modules' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Directory '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/node_modules' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Directory '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/node_modules' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Directory '/home/aj/.cache/bazel/_bazel_aj/node_modules' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Directory '/home/aj/.cache/bazel/node_modules' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Directory '/home/aj/.cache/node_modules' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Directory '/home/aj/node_modules' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Directory '/home/node_modules' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Directory '/node_modules' does not exist, skipping all lookups in it.
    Scoped package detected, looking in 'my__lib'
    Loading module '@my/lib' from 'node_modules' folder, target file type 'JavaScript'.
    Directory '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/node_modules' does not exist, skipping all lookups in it.
    Directory '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/node_modules' does not exist, skipping all lookups in it.
    Directory '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/node_modules' does not exist, skipping all lookups in it.
    Directory '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/node_modules' does not exist, skipping all lookups in it.
    Directory '/home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/node_modules' does not exist, skipping all lookups in it.
    Directory '/home/aj/.cache/bazel/_bazel_aj/node_modules' does not exist, skipping all lookups in it.
    Directory '/home/aj/.cache/bazel/node_modules' does not exist, skipping all lookups in it.
    Directory '/home/aj/.cache/node_modules' does not exist, skipping all lookups in it.
    Directory '/home/aj/node_modules' does not exist, skipping all lookups in it.
    Directory '/home/node_modules' does not exist, skipping all lookups in it.
    Directory '/node_modules' does not exist, skipping all lookups in it.
    ======== Module name '@my/lib' was not resolved. ========
    uselib.ts(1,21): error TS2307: Cannot find module '@my/lib'.
    TSFILE: /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/bazel-out/k8-fastbuild/bin/uselib.js
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.es5.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.es2015.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.dom.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.es2015.core.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.es2015.collection.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.es2015.generator.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.es2015.iterable.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.es2015.promise.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.es2015.proxy.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.es2015.reflect.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.es2015.symbol.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/uselib.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/bazel-out/k8-fastbuild/bin/_validate_uselib-project_options.optionsvalid.d.ts
    /home/aj/.cache/bazel/_bazel_aj/db1f6d7d0bb8398bf62096c2a93a283d/sandbox/linux-sandbox/15/execroot/repro/bazel-out/k8-fastbuild/bin/mylib/_validate_mylib-project_options.optionsvalid.d.ts
    Files: 15
    Lines: 26426
    Nodes: 117013
    Identifiers: 43166
    Symbols: 29691
    Types: 10301
    Memory used: 76825K
    Assignability cache size: 34304
    Identity cache size: 0
    Subtype cache size: 0
    Strict subtype cache size: 0
    I/O Read time: 0.01s
    Parse time: 0.36s
    Program time: 0.37s
    Bind time: 0.17s
    Check time: 0.95s
    transformTime time: 0.01s
    commentTime time: 0.00s
    I/O Write time: 0.00s
    printTime time: 0.01s
    Emit time: 0.01s
    Total time: 1.51s
    Target //:uselib failed to build
    Use --verbose_failures to see the command lines of failed build steps.
    INFO: Elapsed time: 7.265s, Critical Path: 1.92s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully

@alexeagle
Copy link
Collaborator

@gregmagolan did a bunch of refactoring in the module_mappings code such as
f776854
since you have a custom rule to expose your module_name (using non-public APIs I imagine), this change or a related one probably broke you.

@aherrmann
Copy link
Member Author

Thanks for the pointer. I dug a bit more and found that ts_project, as of now, doesn't make use of the module_mappings_aspect and LinkablePackageInfo.

The issue with our tsc use-case can be fixed by adding a LinkablePackageInfo provider to the output of tsc instead of using ts_project.

It would be great to have official upstream support for module_name (or similar) in tsc and ts_project in the future.

@alexeagle
Copy link
Collaborator

LinkablePackageInfo is the official support. You can use a built-in rule that exposes it (like pkg_npm) or if you write your own you should provide one of those.

Glad your use case is unblocked!

@cocreature
Copy link
Contributor

If LinkablePackageInfo is official it would be great if it was supported by ts_project so users don’t have to resort to writing their own rules around tsc.

@alexeagle
Copy link
Collaborator

#1896 for that new feature request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants