SyntaxError: Unexpected token 'export'
harsha09 opened this issue · 1 comments
harsha09 commented
When working with Jest I've encountered the below error message.
SyntaxError: Unexpected token 'export'
> 1 | import urlJoin from 'url-join';
adding "node_modules/(?!(url-join)/)"
in transformIgnorePatterns
did not help.
jonkoops commented
You'll have to run Jest in ESM mode or include the dependency explicitly to transform it into CommonJS. More information can be found in the Jest documentation.