Incompatible with Jest using ESM (Jest encountered an unexpected token
)
#160
Labels
bug
Something isn't working
Jest encountered an unexpected token
)
#160
Versions
Reproduction
When imported into Jest with Native Modules, it fails to compile because the package
exports
points to an ESM file, but there is no matchingtype: "modules"
in package.jsonhttps://github.com/prismicio/prismic-react/blob/master/package.json
I think webpack might figure this one out automatically, but jest is bit of a stickler for the rules.
jestjs/jest#11809 (comment)
Steps to reproduce
Too many to list. Getting jest going with ESM is a PITA
What is expected?
import succeeds
What is actually happening?
Jest encountered an unexpected token
WORKAROUND:
I'm using a custom resolver with a
packageFilter
similar to jestjs/jest#2702 (comment) that monkey-patches the package on-the-fly.The text was updated successfully, but these errors were encountered: