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

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

Closed
JoshuaKGoldberg opened this issue Dec 16, 2022 · 2 comments
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working repo maintenance things to do with maintenance of the repo, and not with code/docs

Comments

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Dec 16, 2022

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.

@JoshuaKGoldberg JoshuaKGoldberg added triage Waiting for maintainers to take a look repo maintenance things to do with maintenance of the repo, and not with code/docs bug Something isn't working accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for maintainers to take a look labels Dec 16, 2022
@JoshuaKGoldberg
Copy link
Member Author

So, dist-raw/node-cjs-loader-utils.js was removed from ts-node in TypeStrong/ts-node#1717. Which makes me pretty confident this is a caching issue. FYI @JamesHenry

@JoshuaKGoldberg
Copy link
Member Author

This was fixed by #6246, I'm pretty sure.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

No branches or pull requests

1 participant