tsconfig-paths icon indicating copy to clipboard operation
tsconfig-paths copied to clipboard

causes error with jest: _jestWorker(...).Worker is not a constructor

Open its-dibo opened this issue 4 years ago • 0 comments

I need to register paths to be used with ts-node so my tsconfig.json looks like:

{
 ts-node:{
   "require": ["tsconfig-paths/register"]
 }
}

but this causes an error when running jest

_jestWorker(...).Worker is not a constructor

I already use moduleNameMapper in my jest.config.js, but I need to register tsconfig-paths to be used when running ts-node

stack:

$ ~/@eng-dibo/dibo: npm t

> @eng-dibo/[email protected] test
> jest

ngcc-jest-processor: running ngcc
TypeError: _jestWorker(...).Worker is not a constructor
    at HasteMap._getWorker (/home/sh_eldeeb_2010/@eng-dibo/dibo/node_modules/jest-haste-map/build/index.js:860:24)
    at HasteMap._processFile (/home/sh_eldeeb_2010/@eng-dibo/dibo/node_modules/jest-haste-map/build/index.js:754:17)
    at HasteMap._buildHasteMap (/home/sh_eldeeb_2010/@eng-dibo/dibo/node_modules/jest-haste-map/build/index.js:807:28)
    at /home/sh_eldeeb_2010/@eng-dibo/dibo/node_modules/jest-haste-map/build/index.js:457:33
    at async /home/sh_eldeeb_2010/@eng-dibo/dibo/node_modules/@jest/core/build/cli/index.js:333:9
    at async Promise.all (index 0)
    at async buildContextsAndHasteMaps (/home/sh_eldeeb_2010/@eng-dibo/dibo/node_modules/@jest/core/build/cli/index.js:315:20)
    at async _run10000 (/home/sh_eldeeb_2010/@eng-dibo/dibo/node_modules/@jest/core/build/cli/index.js:393:41)
    at async runCLI (/home/sh_eldeeb_2010/@eng-dibo/dibo/node_modules/@jest/core/build/cli/index.js:261:3)
    at async Object.run (/home/sh_eldeeb_2010/@eng-dibo/dibo/node_modules/jest-cli/build/cli/index.js:163:37)

its-dibo avatar Sep 15 '21 08:09 its-dibo