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.

Opt out of next.js `componentDidCatch`

See original GitHub issue

Feature 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 screen shot 2018-05-24 at 11 30 25 pm

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
timneutkenscommented, May 25, 2018

I mean, you could add debugger; in componentDidCatch https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger

Anyway we’re planning to remove react-hot-loader soon.

0reactions
brainkimcommented, Jun 27, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

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