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.

React 17.0.0-rc.0 breaks error reporting

See original GitHub issue

Bug report

Describe the bug

When upgrading from 16.13.1 to 17.0.0-rc.0, the runtime error overlay does not display at all.

To Reproduce

In a component, throw an error. This can be either on the server, or purely in the browser. The type of error does not seem to matter - merely that it would be one that triggers the dev error box.

I’ve tried to make this repo as minimal as possible - using create-next-app and removing unnecessary parts.

https://github.com/Winwardo/nextjs-react-17-error-failure/blob/master/pages/index.js https://github.com/Winwardo/nextjs-react-17-error-failure/blob/master/package.json

Expected behavior

Screenshot using React 16.13.1 image

Screenshots

Screenshot using React 17.0.0-rc.0, with console scrolled to where I believe the issue is in NextJS. (Note how the page is completely blank - anything that was previously rendered will be removed.) image

System information

  • Browser: Tested on both Chrome (with an assortment of installed extensions like React devtools, which spits out errors too) and Firefox (with no extensions installed that I’m aware of)
  • Version of Next.js: 9.5.2 (I’ve experienced this on 9.5.1 as well)
  • Version of Node.js: 12.16.3

Additional context

This happens with recent experimental versions of React as well, but it didn’t seem worth making an issue for them as they’re not meant to be supported.

This happens even if I have my own error boundary catching the error (I use https://github.com/bvaughn/react-error-boundary) though I believe that’s part of Next’s philosophy to capture any and all errors, even handled ones.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
gaearoncommented, Aug 28, 2020

Fixed in 17.0.0-rc.1.

2reactions
Winwardocommented, Aug 28, 2020

image

Just tested with 17.0.0-rc.1, looks good to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React v17.0 Release Candidate: No New Features
The part that constitutes a breaking change is that for this to work, React re-executes parts of some of the React functions and...
Read more >
Could not resolve dependency error peer react@"^16.8.0
Try this npm config set legacy-peer-deps true npm i.
Read more >
What's new in React v17, and the road to v18 - LogRocket Blog
0 RC. In this post, we will look into the new changes and updates this new release shipped with. React is a declarative,...
Read more >
What is New in React v17? - CODERSERA
React17 is an essential release because the changes could break down. ... React v17 also includes error handling cases where undefined is returned...
Read more >
How to Handle Errors Efficiently in React - X-Team
Error boundaries are React's way of handling JavaScript errors in React ... hard to know where the error came from, which line of...
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