Opt out of next.js `componentDidCatch`
See original GitHub issueFeature request
Is your feature request related to a problem? Please describe.
I want to have errors thrown in development so I can use the chrome debugger’s pause on exceptions and inspect the error’s environment. The current error rendering provided by next.js swallows the exception and is a lot less useful than chrome’s debugger.
Describe the solution you’d like
Throwing an error in a custom _app.js
causes the error to be caught by some parent component (I think AppContainer?) Maybe a solution is to stop catching errors if we implement a componentDidCatch
in App.js
Describe alternatives you’ve considered
Being a better programmer. (💩 impossible for me tho 💩)
Additional context
Pls. Stop catching my errors when you don’t even catch them in production 😭😭😭 The devtools feature I’m talking about
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Opt out of next.js `componentDidCatch` · Issue #4469 - GitHub
I want to have errors thrown in development so I can use the chrome debugger's pause on exceptions and inspect the error's environment....
Read more >Advanced Features: Error Handling - Next.js
This documentation explains how you can handle development, server-side, and client-side errors. Handling Errors in Development. When there is a runtime error ...
Read more >Upgrade Guide - Next.js
When an application has a custom Babel configuration, Next.js will automatically opt-out of using SWC for compiling JavaScript/Typescript and will fall back to ......
Read more >Upgrading: Version 11 - Next.js beta docs
The next/app component's componentDidCatch was deprecated in Next.js 9 as it's no longer needed and has since been a no-op. In Next.js 11,...
Read more >Advanced Features: Next.js Compiler
js version 12. If you have an existing Babel configuration or are using unsupported features, your application will opt-out of the Next.js Compiler...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I mean, you could add
debugger;
in componentDidCatch https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debuggerAnyway we’re planning to remove react-hot-loader soon.
Update for 6.1. Hot reloading is much nicer! 🎉🎷🎊🥁 Unfortunately, errors in the render path seem to make the page to become unresponsive (devtools can’t be opened, page is not interactive, page will not load on full reload). Not sure if this is better but thanks for your efforts. Let me know if you want me to create a new issue for this.