Next.js Discord

Discord Forum

App Router Error Handling

Unanswered
Mallow bee posted this in #help-forum
Open in Discord
Mallow beeOP
Hi, I watch about Next.js 13 error handling from this video https://youtu.be/CfkiO8wTSOY, but then I realize that error details forwarded in prod is generic error, so I can't get any details of the error.

So how can I display any meaningful error message on the error screen to the users?

3 Replies

Mallow beeOP
Anyone?
European sprat
Catch the errors and display a message accordingly
Dwarf Hotot
Hello @Mallow bee, have you solved this problem ?
I'm facing a strange behavior with error.tsx ... when I run the project with yarn dev it works perfectly, I can get the error message and display the correct error ui depending on the type of error, but when I yarn build && yarn start, I only get a generic error message like "an error occurred in a server component ...." and I lost the hability to display the correct message based on the type of the message ... could it be that error boundaries are not meant to be used like that ?