-
Notifications
You must be signed in to change notification settings - Fork 28
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
Next.js v12 compatibility #281
Comments
I don't know if it is the exact issue you mentioned here or not, This is my test:
This information could be useful:
|
Hi @movahedan, |
I have the same issue. Tested with a clean app created using End up with error:
|
Maybe it has to do with nodejs/node#40602. Debugging into await loadConfig where it tries to load the --edit Probably more adequate issue because nodejs/node#35889 is mentioning jest as well. |
vercel/next.js#29935 seem to have caused it and the followup vercel/next.js#29971 mentions the segfault on node 14 for other platforms than linux. However, the platform i am experiencing this behaviour is a NixOS with node 16.13.0. --edit Oh gosh. It's a deep rabbit hole that goes far beyond the time i am willing to spend right now. --edit--edit The overall picture seems to be that there are issues running esm dynamic imports in nodes vm module (therefore the experimental flag) and jests usage of that vm module, probably being multiplied by mixing cjs and esm module loading in tests dependencies but this again is wildly speculative. |
Hello, I ran into the same issue and I was able to fix using jest moduleNameMapper. The issue it's related to the default function exported from this file So in jest.config file add an entry on the moduleNameMapper That worked for me! Hope this helps |
Maybe this is also an issue with Next 12. Next-page-tester's render method does not render anything and ignores assertions. The test just simply stops running after invoking the render method. |
@toomuchdesign is there anything we can do to help? |
Hi @jasonwilliams, unfortunately in the near future I won't be able to spend time on |
@toomuchdesign do you know why v12 doesn’t work? I think we can sort out a fork and fix it but in this thread I’m keen to know why it stopped working in this release. |
Unfortunately I haven't had the opportunity to dig into Next 12 changes. |
I hope to take a look at this again soon, but won’t be for a while. If anyone has any useful info feel free to add here. From looking at the upstream issues it seems node hasn’t fixed the segfaults |
There's a new PR open for this. The type errors have been sorted for now #294 Will need help deciding what to do about Jest though. I wonder if switching to Vitest would help solve this. Thoughts @calbrecht @Meemaw ? |
Just to update everyone on what's going on here.. The segfaults look to be coming from a mix of require and import, plus the way Jest operates. How can I help?Short TermThe short term fix is to resolve the Type Issues and segfaults in Jest tests. This is #294 It looks like we've fixed the main issue by swapping to import in some places. The case here is to try and test this PR out and give feedback. If we can get something out without breaking other test runners that would be good to know. Long TermThe long term fix is to migrate to Vitest. The PR is here #295 Do you use something other than Jest?Your help is needed in #294 |
@jasonwilliams it's too early for concluding that Jest won't be supported anymore. Considering how popular is the package, it's likely that someone else or another organization might start leading its contributions. Worth noting that Vitest is still in development and it isn't yet stable as per their own documentation, and Jest has still 300 times more weekly downloads. Next.js documentation also still only points into the direction of using Jest. |
@IGassmann you're right, this isn't about dropping support for Jest per-say. But providing us a path to move forward and not being blocked by what's happening with Jest. Internally this could change its test suite and still work with other test runners people use. It's true Vitest is in development right now, but the support for native ESM Modules is a direction we want to head in, so building against that works quite nicely right now. |
Hi @jasonwilliams. have you had the opportunity to get what is exactly causing the esm/commonjs hell? Was setting the I tried to understand more about the nature of the issue and found this article very well written. |
Hey everyone You can install it by using either:
Please feedback and let us know how it works for you |
Hi Everybody, |
🐛 Bug Report
As this PR shows,
next-page-tester
has issues with Next.js v12. At a first sight I found:segmentation fault
error while running testsI can't predict when I'll be able to work on it. As usual contributions are very welcome 🙌
Reproduction
#280
The text was updated successfully, but these errors were encountered: