25:31 The custom error message thrown from page.js is successfully caught in the error.js file, but it only works on the development server. In the production server, Next.js does not allow custom error messages to be displayed. Instead, it shows a generic message, claiming this is done for security reasons. The error message shown in production is: “An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details.” Is there any way to display my custom error message in production, just like in the development server?
It is pretty tricky to do with error.js in the production. As much as I remember, you have to create custom error and provide a custom digest so that React will not override it and only then it appears on the production.
25:31 The custom error message thrown from page.js is successfully caught in the error.js file, but it only works on the development server. In the production server, Next.js does not allow custom error messages to be displayed. Instead, it shows a generic message, claiming this is done for security reasons.
The error message shown in production is:
“An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details.”
Is there any way to display my custom error message in production, just like in the development server?
It is pretty tricky to do with error.js in the production. As much as I remember, you have to create custom error and provide a custom digest so that React will not override it and only then it appears on the production.
Sir I love the way you teach .With so much clarification
Glad to hear that
As always, extremely good explanation. I come mainly from backend, and your videos are being valuable building my SaaS using NextJs for front end.
@@legiampaoli super 👌
Very Clear Explaination ... once some one watch this properly it will tough for him to forget the concepts i believe... Thanks.
Thank you, glad you liked ❤️
Good
Thanks
Your video is amazing with so much details.And the way you teach sir
Thank you very much!
Thank you very much for your very informative tutorials. I'm enjoying a lot. 41:38 you said that your are going to discuss on "not found" but didn't.
Thank you! Planning a new video on it sir 🙌
good explanation dada🥰
Thanks vai, glad you liked ❤️
good video but what was missing for me was how to catch errors when prefetching data from a server component
@@phillipjacowski ok can be separate video, thanks for looking into it.
Awesome video.... Unfortunately I can't like more than once. My one like ===1M like...
Thanks
Wow.. thanks a lot man.. so happy to know it helped and you liked it...