-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
🐛 Bug: Node 22 breaks react/webpack example #103
Comments
Thanks for filing! I transferred this over to the right repo. Could you please post the error messages you're seeing? Just a note that "it doesn't work" isn't quite enough to go off of. When I try with Node 22.12.0, I get:
|
I apologize. Yes, here is the message (pretty much the same one you got there:
Then if I set
I believe this is related to mocha/webpack/babel/node attempting to parse files in a different way or order now. Node 22 tries to parse the file in both ESM and CommonJS and falls back to one with the other fails. This might be an issue with webpack, babel, or mocha not handling the errors node is throwing at it, or something else because it seems to work fine in previous versions of node. |
Bug Report Checklist
faq
label, but none matched my issue.Expected
I expect to be able to run
mocha
andwebpack
with the same code using babel to transpile the code.Actual
mocha
runs the tests but the @babel/register isn't working properlyMinimal, Reproducible Example
I used the
react-webpack
example in the mocha-examples repo.https://github.com/mochajs/mocha-examples/tree/main/packages/react-webpack
Versions
Additional Info
If I change the "type" in the
package.json
tocommonjs
, the tests start working, but webpack starts failing.It's possible there's a solution that doesn't involve changing mochajs and it's just a configuration that's missing. In that case, this is more of an issue with the examples not working anymore.
The text was updated successfully, but these errors were encountered: