Skip to content
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

Jest setup "SyntaxError: Unexpected token export" since the upgrade to 3.0.3 #32

Closed
jogelin opened this issue Dec 20, 2022 · 1 comment

Comments

@jogelin
Copy link

jogelin commented Dec 20, 2022

I'm submitting a...


[X] Regression (a behavior that used to work and stopped working in a new release)

Current behavior

When upgrading from 3.0.2 to version 3.0.3, I have an error in my Jest tests related to components using the dirty-check-library.

In fact, now the library is using lodash-es that is exposing esm module not recognized by Jest.

Expected behavior

Using a new MINOR version instead of the PATCH version when upgrading a library.

@jogelin
Copy link
Author

jogelin commented Dec 20, 2022

Solution

Ignore the lodash-es library in your Jest config:

{
...
    transformIgnorePatterns: [`<rootDir>/node_modules/(?!.*\\.mjs$|lodash-es)`],
...
}

More details: https://stackoverflow.com/questions/42260218/jest-setup-syntaxerror-unexpected-token-export

@jogelin jogelin closed this as completed Dec 20, 2022
@jogelin jogelin changed the title Jest setup "SyntaxError: Unexpected token export" since the upgrade to 3.0.3 + Solution Jest setup "SyntaxError: Unexpected token export" since the upgrade to 3.0.3 Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant