-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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]: Failed to parse the TypeScript config file with [email protected] #15312
Comments
We are having the same issue, strangely enough it is only one module that is failing at our end.
|
Could you try renaming the file to |
Hello @JoostK After I renamed the file to
|
Same here: ` ● Test suite failed to run
` |
Same:
|
I'm having the same issue, but not with Node 22: https://github.com/Vonage/vonage-node-sdk/actions/runs/10997790768 |
Same issue for me, I have a I am linking the changelog which mentions a behavior change for ES6 modules, but I really don't understand how this break jest (or ts-jest). https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/ |
Ok, I do understand it - here is the precise problem: microsoft/TypeScript#59991 Alas, the answer is "working as intended". Before 5.6, TypeScript would output whatever it was configured to output. Since 5.6, if the module is a |
Time to go back to the good ol' transform: {
'\\.tsx?$': [
'ts-jest',
{
tsconfig: {
outDir: './.ts-jest'
}
}
],
'\\.jsx?$': ['babel-jest', {plugins: ['@babel/plugin-transform-modules-commonjs']}]
},
transformIgnorePatterns: [
'/node_modules/(?!(yourstuff))'
],
Keep |
@mmomtchev Yeah, that is another workaround until this is addressed, but it's not ideal. When using Babel, you lose the type checking in your tests. Hopefully, this can be addressed by providing more support for ESM. However, I think that will not happen since Node can support mixing CJS and ESM in the future. Its unlikely we will get this resolved for Node 18 and 20 (which is still in LTS) |
No, you still use |
@manchuck how do you get it to work with Node 22? Doesn't work for me with Node 22 until I force TS to version 5.5.4. |
@mmomtchev sorry I meant you loose type checking for your test scripts. Yes you still get TS checking for code. Apologies for the mis type @patricklafrance I didn't do anything it was working just fine with 22. Here is the run that passed in our action: https://github.com/Vonage/vonage-node-sdk/actions/runs/10997790768/job/30534604593 |
@manchuck why would the rules be different for the tests? Are you tests named @patricklafrance he is in a very specific particular case of this issue, because unlike us, he is not transpiling any external |
In my project https://github.com/wtto00/android-tools, after I switched to
However, it is still unclear why node20 cannot work properly while node22 can. |
@mmomtchev yes
In terms of node 22 it could be how I'm running the tests with |
@manchuck now it is because it is described in the documentation? For both the tests and the code? Or only for the code without the tests? 😄 This configuration runs TypeScript code through |
@mmomtchev Babel will not type check tests. I don't know how else to explain it. I recently reviewed the entire code base to ensure that tests were correctly typed by removing babel: Vonage/vonage-node-sdk@e361fbe Babel will not type check tests. It will type check code. The documentation on that is correct. |
Yes, but so is my statement that |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Bump |
I'm using a project with ESM settings:
After upgrading to node v22.11.0, the error mentioned in this issue disappeared in almost all modules of the monorepository. But it was still issued if After I commented out |
Relevant tsconfig issue: jestjs/jest#15312
Version
29.7.0
Steps to reproduce
After I upgraded
typeScript
version from5.5.4
to5.6.2
, my test pipeline execution failed.My execution failed pipeline is https://github.com/wtto00/android-tools/actions/runs/10907495575/job/30271298092
Expected behavior
jest --detectOpenHandles --verbose
executed successfully.Actual behavior
jest --detectOpenHandles --verbose
execution failed, the failure information is as follows:Additional context
Related dependency versions:
Environment
The text was updated successfully, but these errors were encountered: