-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Closed
Copy link
Labels
Description
Version
27.5.1
Steps to reproduce
Use this repo: https://github.com/noahnu/repro-source-map-error (h/t @noahnu for making this)
yarn installyarn ts-node --transpile-only $(yarn bin jest)
Expected behavior
Test should pass.
Actual behavior
% yarn ts-node --transpile-only $(yarn bin jest)
FAIL ./index.test.ts
● Test suite failed to run
Cannot find module 'source-map-support' from '/Users/francis/temp/repro-source-map-error/.yarn/cache/@cspotcode-source-map-support-npm-0.7.0-456c3ea2ce-9faddda775.zip/node_modules/@cspotcode/source-map-support'
at resolveSync (.yarn/cache/resolve-patch-bad885c6ea-c79ecaea36.zip/node_modules/resolve/lib/sync.js:111:15)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.132 s
Ran all test suites.
Additional context
The original issue is: cspotcode/node-source-map-support#35, but it seems to be a Jest problem.
Here is the a patch that fixes it (thanks to @cspotcode )
Replace this code:
with:
const resolved = require.resolve('source-map-support');
runtime.requireInternalModule(resolved, resolved).install(sourcemapOptions);
This might be related to:
Environment
System:
OS: macOS 12.1
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 14.17.3 - ~/.nvm/versions/node/v14.17.3/bin/node
Yarn: 3.1.1 - /usr/local/bin/yarn
npm: 8.1.0 - ~/.nvm/versions/node/v14.17.3/bin/npmMethuselah96 and Kurt-von-Laven