Next.js Discord

Discord Forum

Error Boundary Question

Unanswered
Crème D’Argent posted this in #help-forum
Open in Discord
Crème D’ArgentOP
I am on NextJS v 13.5.6. I am wanting to catch application errors and send them to a 3rd party service to log javascript errors that happen.
I have an ErrorBoundary wrapper surrounding the components that load in _app.js. But as I am developing locally, I don't see that errors are actually being surfaced to the ErrorBoundary wrapper. I have the React Error that shows up on the page, but nothing gets logged from my componentDidCatch function in the ErrorBoundary class. Is the React Error Blocking Error Events from being surfaced to the ErrorBoundary?

1 Reply

Acacia-ants
Hello Dan. If you post some code that will be helpful. Keep in mind that the error boundaries are basically a try catch statement. That being said only unhandled exceptions can propagate to them. If anywhere in the code you are handling an exception and then logging an error to the console that error will not propagate to the ErroundBondary.