-
Notifications
You must be signed in to change notification settings - Fork 455
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
[Bug]: ts-jest 29.2 breaks dependency transform #4473
Comments
Hi, your issue is the same as #4464, you can check my explanation here #4464 (comment) The main reason is that your test is using |
um... thanks. Seems like that needs to be a tsconfig that is specifically for This is because It is still possible by building ESM with |
I was thinking about adding a check on |
As a user, I generally don't like those warnings. 😄 > @repobuddy/jest@4.1.0 test /home/unional/code/repobuddy/repobuddy/packages/jest
> cross-env NODE_OPTIONS=--experimental-vm-modules NODE_OPTIONS=--experimental-import-meta-resolve jest
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
RUNS ts/presets/ts-watch/jest-preset.spec.ts
RUNS ts/presets/watch/jest-preset.spec.ts
RUNS ts/presets/ts-esm-watch/jest-preset.spec.ts
RUNS ts/presets/ts-esm/jest-preset.spec.ts
RUNS ts/presets/ts-cjs/jest-preset.spec.ts
RUNS ts/presets/ts-cjs-watch/jest-preset.spec.ts
RUNS ts/presets/ts/jest-preset.spec.ts
RUNS ts/presets/jsdom-ts-watch/jest-preset.spec.ts
RUNS ts/presets/jsdom-ts-esm-watch/jest-preset.spec.ts
RUNS ts/presets/jsdom-ts-esm/jest-preset.spec.ts
RUNS ts/presets/jsdom-ts-cjs/jest-preset.spec.ts
RUNS ts/presets/jsdom-ts-cjs-watch/jest-preset.spec.ts
RUNS ts/presets/jsdom-ts/jest-preset.spec.ts
RUNS ts/presets/js-esm-watch/jest-preset.spec.ts
RUNS ts/presets/js-esm/jest-preset.spec.ts When I saw it the first time, it may be good information. I would prefer to keep them in a troubleshooting section of readme or the doc Or if you can intercept the |
Oh it's not possible to intercept Maybe we update doc to instruct using ESM and troubleshooting page as well of course. How about that? |
Actually, I'm curious when does the I have tried adding However, that would break the tsserver as it uses I tried adding Maybe I need to set that in the global setting? (I am away from my computer now, can check that tomorrow) UPDATE: I guess |
Oh I found out your configuration in https://github.com/repobuddy/repobuddy/blob/851bacacfc0fd6828d58af8fddfbf24fa19f9b44/packages/jest/jest.config.mjs#L34 was a bit wrong. the transformer option should be an object
but you put as an array
If you correct this, you don't need to change anything about |
Ar, thanks. Didn't realize that. On the other hand, I tried doing the It doesn't work because under You will get error like this: Cannot find module 'type-plus' from 'src/utils/define_columns.spec.ts' I'm using UPDATE: correction, "exports": {
".": {
"import": {
"types": "./esm/index.d.ts",
"default": "./esm/index.js"
},
"default": "./esm/index.js" // <-- this
},
"./package.json": "./package.json"
}, which is not right for CJS build. I think I have that for some browser need but I could be wrong. I was testing this by removing that line directly in Publishing |
Sounds good. |
Do you still have the issue |
Yes but it is in a private repo. |
I tried to create a testcase but I run into I saw some closed issues e.g.: #2399 It's the test in https://github.com/repobuddy/repobuddy/tree/main/testcases/dual-ts-jest It can be executed through The same condition is working when using |
I'm very sorry, but I don't understand this breaking change.
|
@MBurchard what's the error did you get? Also, what's your TS version and are you using module Node16/NodeNext? |
I'm thinking about reverting the support for |
I have a small project: https://github.com/MBurchard/bit-log I would also prefer this topic to be moved to the next major release and for there to be a well-documented solution that does not use experimental flags. |
Confirmed that the |
Thanks for the feedbacks 🙏🙏 |
Version
29.2.3
Steps to reproduce
Expected behavior
test pass
Actual behavior
Debug log
see above
Additional context
It is working with
ts-jest
29.1the transform config is:
I have also tried to use
transformIgnorePatterns
but also not working.Environment
The text was updated successfully, but these errors were encountered: