Jest encountered an unexpected token inside ts-jest/node_modules/jest-util #3190
-
Hi all, I'm trying run jest using ts-jest, but I'm running into the following error:
For more context, I have the following setup:
I've tried:
Does anybody have any idea on what could be going on? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
I see you are using incompatible combination of Jest and ts-jest. Maybe downgrading ts-jest to 24 could help since you are using jest 24 |
Beta Was this translation helpful? Give feedback.
-
I'm having a similar problem, my package.json file (snippet) has:
This worked fine when the downloaded versions were jest: "27.2.4" & "ts-jest": "27.0.5", but since it's configured as ^ I removed yarn.lock to upgrade other dependencies and now it upgraded jest to 27.4.6 & ts-jest to 27.1.3 and I have an error similar to what OP posted. The problem is that I cannot simply fix jest version by removing the ^ symbol in package.json because jest internally has dependencies marked with the caret, hence it ends up downloading 27.4.6 Any clue how to fix this? |
Beta Was this translation helpful? Give feedback.
I see you are using incompatible combination of Jest and ts-jest. Maybe downgrading ts-jest to 24 could help since you are using jest 24