Skip to content

Repo: ts-node CI-only error: Cannot find module '../dist-raw/node-cjs-loader-utils' #6230

Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Suggestion

I've seen this in a few PRs. Example: #6091 -> https://github.com/typescript-eslint/typescript-eslint/actions/runs/3716238438/jobs/6302406471:

Run yarn test-integration
  yarn test-integration
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    PRIMARY_NODE_VERSION: 18
    yarn_cache_dir: /home/runner/.cache/yarn/v6
    CI: true
yarn run v1.[2](https://github.com/typescript-eslint/typescript-eslint/actions/runs/3716238438/jobs/6302406471#step:5:2)2.19
$ yarn jest -c ./tests/integration/jest.config.js
$ /home/runner/work/typescript-eslint/typescript-eslint/node_modules/.bin/jest -c ./tests/integration/jest.config.js
Error: Cannot find module '../dist-raw/node-cjs-loader-utils'
Require stack:
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/ts-node/dist/index.js
- /home/runner/work/typescript-eslint/typescript-eslint/tests/integration/jest.config.js
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/jest-util/build/requireOrImportModule.js
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/jest-util/build/index.js
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/jest-config/build/getCacheDirectory.js
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/jest-config/build/Defaults.js
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/jest-config/build/normalize.js
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/jest-config/build/index.js
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/jest-cli/build/init/index.js
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/jest-cli/build/cli/index.js
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/jest-cli/build/index.js
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/jest-cli/bin/jest.js
- /home/runner/work/typescript-eslint/typescript-eslint/node_modules/jest/bin/jest.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:10[3](https://github.com/typescript-eslint/typescript-eslint/actions/runs/3716238438/jobs/6302406471#step:5:3):18)
    at Object.<anonymous> (/home/runner/work/typescript-eslint/typescript-eslint/node_modules/ts-node/dist/index.js:50:7)
    at Module._compile (node:internal/modules/cjs/loader:1159:1[4](https://github.com/typescript-eslint/typescript-eslint/actions/runs/3716238438/jobs/6302406471#step:5:4))
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:10[6](https://github.com/typescript-eslint/typescript-eslint/actions/runs/3716238438/jobs/6302406471#step:5:6)1:1[9](https://github.com/typescript-eslint/typescript-eslint/actions/runs/3716238438/jobs/6302406471#step:5:10))
error Command failed with exit code 1.

I wonder if it's an issue with the node_modules cache? This failure only happens in CI, not locally.

In #5251 I switched to https://github.com/esbuild-kit/tsx without issue. But it'd be nice to know why ts-node is crashing - especially if it's a caching issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingrepo maintenancethings to do with maintenance of the repo, and not with code/docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions