Closed dermyhughes closed 1 year ago
Try
"transformIgnorePatterns": [
"/node_modules/(?!(get-user-locale))"
]
Jest is notoriously bad at dealing with ESM modules... In 2023.
Thank you! I thought I had already tried this while debugging with no luck but this has solved the issue.
Hi,
We have components that have
get-user-locale
as a dependency. As ofv2.2.0
, our Jest tests are failing due to aSyntaxError: Cannot use import statement outside a module
error. Rolling back tov2.1.3
fixes the issue.We have followed the Jest docs mentioned in the error to resolve but have been unable to fix.
Full error example below: