-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
SyntaxError: Unexpected token 'export'
with jest on version 4.0.0
#10
Comments
The switch to ESM is intentional unifiedjs/unified#121 There was some discussion about Jest support in https://twitter.com/kentcdodds/status/1369803853005209602 and sindresorhus/meta#15 Short answer this is something that needs to be fixed in Jest and is in progress https://jestjs.io/docs/ecmascript-modules |
@ChristianMurphy Thanks for the details - you can consider this issue resolved now. Will comment again or raise a new one should it be needed. Thank you! |
Hey @ChristianMurphy do you happen to know if this has ever been resolved? I still struggle to use unified in Jest, it throws this very error for me. |
Heya @ZeldOcarina! The answer remains the same as previous comments. Jest is one of the libraries that has struggles. Though with the challenges folks have faced, I come back to:
There are alternatives like:
I'm going to keep this issue closed, as fixing JavaScript support in Feel free to follow up with the Jest community if you have questions on how to configure |
Hi there,
I'm upgrading a project from version
3.1.0
->4.0.0
of this project but am having an issue when trying to run jest tests.When running tests I see
SyntaxError: Unexpected token 'export'
referencing the rootindex.js
file of this project.I am running node
14.16.0
.Google suggests this could be related to the way in which the export is defined and how that works with node - https://stackoverflow.com/questions/38296667/getting-unexpected-token-export
I am importing as
import {stringifyEntities} from 'stringify-entities'
and calling asstringifyEntities(value, {escapeOnly: true})
Any ideas? 😃
Thanks,
Jake.
The text was updated successfully, but these errors were encountered: