question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Next.js v12 compatibility

See original GitHub issue

šŸ› Bug Report

As this PR shows, next-page-tester has issues with Next.js v12. At a first sight I found:

  • some types issues
  • an unexpected segmentation fault error while running tests

I can’t predict when I’ll be able to work on it. As usual contributions are very welcome šŸ™Œ

Reproduction

https://github.com/toomuchdesign/next-page-tester/pull/280

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:13
  • Comments:19

github_iconTop GitHub Comments

4reactions
movahedancommented, Nov 3, 2021

I don’t know if it is the exact issue you mentioned here or not, I get this Segmentation fault (core dumped) when I’m trying to test my pages after upgrading to next@12.0.2

This is my test:

        it('page renders and matches snapshot', async () => {
		const { serverRenderToString, render } = await getPage({
			route: '/_error',
		});

		// check correctness of SSR result
		const { html } = serverRenderToString();
		expect(html).toMatchSnapshot();

		// check hydrated app
		const { nextRoot } = render();
		expect(nextRoot.outerHTML).toMatchSnapshot();
	});

This information could be useful:

"next": "^12.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"jest": "^27.1.0",
"babel-jest": "^27.1.0",
2reactions
calbrechtcommented, Nov 5, 2021

Maybe it has to do with https://github.com/nodejs/node/issues/40602. Debugging into await loadConfig where it tries to load the next.config.js file by calling await import is leading to the segfault.

–edit Probably more adequate issue because https://github.com/nodejs/node/issues/35889 is mentioning jest as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blog - Next.js 12
The new Rust compiler is backwards compatible. If you have an existing Babel configuration, you will automatically be opted out.
Read more >
Upgrade Guide - Next.js
Next. js provides full backwards compatibility with applications that have custom Babel configuration.
Read more >
Upgrading: Version 12 - Next.js beta docs
Next.js provides full backward compatibility with applications that have custom Babel configuration. All transformations that Next.js handles by defaultĀ ...
Read more >
Blog - Next.js 12.2
You can now opt into this behavior in a backward-compatible way. We've added experimental support for shipping only modern JavaScript byĀ ...
Read more >
Blog - Next.js 12.3
Next.js 12.3 introduces TypeScript Auto-Install, improved Fast Refresh, stable new Image Component, and more!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found