Next.js Discord

Discord Forum

Custom error.tsx page is not rendered for dynamic routes using generateStaticParams

Unanswered
Ratonero Valenciano posted this in #help-forum
Open in Discord
Ratonero ValencianoOP
I have a fairly large localized (next-intl) website which has multiple dynamic routes. I'm using generateStaticParams to prerender localized routes.

I'm facing an issue where error.tsx is not catching errors on the app and the default Vercel error screen is displayed instead of my own custom error.tsx component

- Error boundaries work fine without generateStaticParams
- As soon as generateStaticParams is added (along with dynamicParams = true), error boundaries stop catching errors for dynamic routes (the ones not pre-rendered during build) in production, while working perfectly in dev mode.

I found this year-old issue (https://github.com/vercel/next.js/issues/62046) but there have been no activity on this thread. I'm trying to find an alternate workaround for this and would really appreciate any suggestions you must have.

0 Replies