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 configuration doesn't support pure-ESM packages #1000
Comments
I started looking into this and so far found two potential options that will allow this repository to accept pure ESM dependencies with Jest:
|
During triage, the team agreed that the second option (updating tsconfig) is the better option as it has lower overhead. This can move forward once the Node 16 work is in. |
In case it's helpful for others: I ended up running |
This was resolved in #1268 |
We've recently seen some dependabot updates to packages that are pure-ESM. This issue lists updates whose builds failed & whose update path wasn't immediately obvious - I didn't want to lose track of them. Looking closer & updating this description as we go
At first I thought this was because this repo targets Common JS; in general, trying to import ESM packages into CommonJS requires dynamic await() imports. I thought we'd need to follow the steps listed here: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
After trying the update locally, I noticed webpack overrides the require function so that overall index.js is still functional. The PR build failures come from jest tests with the error signature:
Jest has experimental support for ECMAScript modules. We can try changing its configuration to unblock these PRs. We can also choose to defer the PRs. We have a little more leeway since we aren't exporting a library of our own.
The text was updated successfully, but these errors were encountered: