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
Not compatible with jest version 28 #183
Comments
Thank you for opening an issue, Mark. I will investigate today |
I'm afraid the issue may with your build system. Would you like to share some project details? I've successfully tested using Jest with no build, using both native ESM and commonjs. |
UpdateThe following change also did not make Jest resolve to commonjs - "browser": "./index.mjs",
+ "browser": {
+ "import": "./index.mjs",
+ "require": "./index.js"
+ },
- "node": "./index.mjs",
+ "node": {
+ "import": "./index.mjs",
+ "require": "./index.js"
+ }, Jest resolve the module without modules in VM flag. I'm open to suggestions |
This helped me: https://stackoverflow.com/questions/60714101/how-to-setup-jest-with-node-modules-that-use-es6 Adding |
So it is a transforming issue. I'm closing this issue but please don't hesitate if you're having any other issues |
I spoke to soon, apparently my yarn had updated on this branch to a previous version and that's why it passed. my fix above does not work with Jest 28. My apologies. Still experiencing the export issue. |
I've added babel transpiling, removed VM module flag, and typescript tests. |
Im using a standard NextJS setup. There is some webpack config but mainly for Sentry. Next 12.1.5 using their SWC compiler (no babel) jest.config.ts
tsconfig
|
Still can't reproduce. Would you like to try and test using? {
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
} |
@wadehammes Good news, If you could please test the next version using "next" tag - we can see that it solved the issue for you and release a stable version:
|
@omrilotan this resolved the issue, thank you! |
Brilliant.Ill release a version in about 30 minutes. Thank you for taking the time |
Resolved in version 3.5.0 |
Steps to reproduce
import isbot from 'isbot'
anywhere in a file that's tested.install and use
jest@28
to test the file.Expected behaviour
The isbot import should work.
Actual behaviour
Jest throws an error about unexpected token inside isbot.
Additional details
Jest@28 started supporting exports in package.json;
https://jestjs.io/docs/upgrading-to-jest28#packagejson-exports
This is why this breaks, and it suggests submitting an issue to
isbot
to fix the exports in this package to be correct.The text was updated successfully, but these errors were encountered: