question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jest SyntaxError: Unexpected token 'export'

See original GitHub issue

After upgrading from 15.1.1 to 16.0.1 I’m getting the following error in my react unit tests. Any help would be much appreciated.

Screen Shot 2022-04-21 at 11 38 35 PM

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:38
  • Comments:34

github_iconTop GitHub Comments

16reactions
ozee31commented, May 3, 2022

Add transformIgnorePatterns not works for me

15reactions
benwiley4000commented, Apr 28, 2022

Our team is going to avoid upgrading until this issue is resolved. Seems very unusual to put raw ES exports in the main (non-ES) module.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest gives an error: "SyntaxError: Unexpected token export"
This means, that a file is not transformed through TypeScript compiler, e.g. because it is a JS file with TS syntax, or it...
Read more >
Jest SyntaxError: Unexpected token 'export'
Probably it was caused by hurrying up writing a component and autocompleting an import with an IDE help. For Webpack it is fine...
Read more >
syntaxerror unexpected token export babel-jest - You.com
1.Jest gives an error: “SyntaxError: Unexpected token export”. Descriptions: This means, that a file is not transformed through TypeScript compiler, e.g. ...
Read more >
TypeScript Jest: Unexpected Token Export - Reddit
But most likely you will want to use common JS modules. Check your ts-config module settings to output to commonjs, and update your...
Read more >
Jest: Unexpected token 'export' - Sendbird Community
[Problem/Question] Hi ! When I run my tests using Jest, I got an SyntaxError: Unexpected token 'export' from node_modules/@sendbird/chat/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found