-
-
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]: SyntaxError: Unexpected token ':' at Runtime.loadEsmModule (node_modules/jest-runtime/build/index.js:516:20) #15299
Comments
Hope this helps. I had the exact same issue only it was:
Semi colon instead of a colon. Right before that I was working on another issue and I had changed:
to
.. though I'm not sure why I did that. I put it back to have babel-jest and ran it again. That error above went away and instead I got a long stack-trace:
I removed that semi colon from the end of |
I think you may added ; at the place of : but In my case I was getting error related to : in jest-runtime/build. The same code I had run with Vitest it was working with Vitest. I don't know why it wasn't working with Jest. |
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. |
What could be way to avoid this error ? |
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. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
1 similar comment
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
^29.7.0
Steps to reproduce
Can't share a repo because of confidential reasons.
Expected behavior
I expected that test will run.
Actual behavior
ReferenceError: You are trying to
import
a file after the Jest environment has been torn down. From test/api/agents/index.test.ts.ReferenceError: You are trying to
import
a file after the Jest environment has been torn down. From test/api/agents/index.test.ts.FAIL test/api/agents/index.test.ts
● Test suite failed to run
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.668 s
Ran all test suites.
(node:6932) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use
node --trace-warnings ...
to show where the warning was created)Additional context
jest.config.ts
Environment
The text was updated successfully, but these errors were encountered: