[Bug]: TS 5.2+ fails if using nodenext
module resolution and noEmitOnError
is true
#4246
Labels
nodenext
module resolution and noEmitOnError
is true
#4246
Version
29.1.1
Steps to reproduce
Set up your package as a module, and use any Typescript version greater than or equal to 5.2.2:
In your tsconfig.json, use
nodenext
module resolution, and setnoEmitOnError
totrue
:Set your jest config to use ts-jest:
Set up a simple test with ts-jest:
Run it:
Expected behavior
The test should pass (which it does on TS 5.1.6 and below).
Actual behavior
On TS >= 5.2.2, the test fails with the error:
Downgrading to TS 5.1.6 allows the test to pass. Or setting
noEmitOnError
in tsconfig.json tofalse
also allows the test to pass.Debug log
ts-jest.log
Additional context
No response
Environment
System: OS: macOS 14.1.2 CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz Binaries: Node: 20.9.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.1.0 - /usr/local/bin/npm pnpm: 8.10.2 - /usr/local/bin/pnpm npmPackages: jest: ^29.7.0 => 29.7.0
The text was updated successfully, but these errors were encountered: