<#18597 Various JavaScript rules fail to bootstrap...
# github-notifications
c
#18597 Various JavaScript rules fail to bootstrap on 2.17-dev if the cached JavaScript toolchain is corrupted Issue created by chrisjrn I'm running
./pants test --changed-since=origin/main
, which is failing because the JavaScript parser rules can't get bootstrapped:
Copy code
Traceback (most recent call last):
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
    res = rule.send(arg) if err is None else rule.throw(throw or err)
  File "/Users/chrisjrn/src/pants/src/python/pants/vcs/changed.py", line 75, in find_changed_owners
    dependents = await Get(
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 118, in __await__
    result = yield self
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
    res = rule.send(arg) if err is None else rule.throw(throw or err)
  File "/Users/chrisjrn/src/pants/src/python/pants/backend/project_info/dependents.py", line 27, in map_addresses_to_dependents
    dependencies_per_target = await MultiGet(
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 358, in MultiGet
    return await _MultiGet(tuple(__arg0))
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 165, in __await__
    result = yield self.gets
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
    res = rule.send(arg) if err is None else rule.throw(throw or err)
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/graph.py", line 1193, in resolve_dependencies
    inferred = await MultiGet(
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 358, in MultiGet
    return await _MultiGet(tuple(__arg0))
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 165, in __await__
    result = yield self.gets
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
    res = rule.send(arg) if err is None else rule.throw(throw or err)
  File "/Users/chrisjrn/src/pants/src/python/pants/backend/javascript/dependency_inference/rules.py", line 102, in infer_js_source_dependencies
    import_strings = await Get(JSImportStrings, ParseJsImportStrings(source))
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 118, in __await__
    result = yield self
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
    res = rule.send(arg) if err is None else rule.throw(throw or err)
  File "/Users/chrisjrn/src/pants/src/python/pants/backend/javascript/dependency_inference/import_parser/rules.py", line 45, in install_javascript_parser
    result = await Get(
  File "/Users/chrisjrn/src/pants/src/python/pants/engine/internals/selectors.py", line 118, in __await__
    result = yield self
pants.engine.process.ProcessExecutionFailure: Process 'install @pants/javascript-source-import-parser modules.' failed with exit code 1.
stdout:

stderr:
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '../lib/cli.js'
Require stack:
- /private/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/immutable_inputs3PcUCe/.tmpCkBPBV/a97a3f6ba08afdca934b08117b3f19f04975937860fa883bf39cc26c20ec8406/node-v16.15.0-darwin-arm64/bin/npm
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/private/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/immutable_inputs3PcUCe/.tmpCkBPBV/a97a3f6ba08afdca934b08117b3f19f04975937860fa883bf39cc26c20ec8406/node-v16.15.0-darwin-arm64/bin/npm:2:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/private/var/folders/0m/h2n902qn38b8555xq8z0w_h40000gn/T/immutable_inputs3PcUCe/.tmpCkBPBV/a97a3f6ba08afdca934b08117b3f19f04975937860fa883bf39cc26c20ec8406/node-v16.15.0-darwin-arm64/bin/npm'
  ]
}



Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
It appears as though there are
javascript_sources
in
BUILD
files in the Pants repo that require specific dependencies to be present on the machine. Disabling the
javascript
backends fails because there are
javascript_sources
in the repo. pantsbuild/pants