Error occurred prerendering page "/404" #12246
-
I keep getting the following error when running
I don't have a custom 404 page because I want it to be handled by the Obviously If it helps, here's the code for my
|
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 16 replies
-
As a follow-up: I also saw this discussion #11945, but the answer doesn't help me in anyway because I do not want the error page to be static. |
Beta Was this translation helpful? Give feedback.
-
This can't be proper behavior. I created an issue for it: #12256 |
Beta Was this translation helpful? Give feedback.
-
I was able to solve it by changing the
|
Beta Was this translation helpful? Give feedback.
-
same issue here, can't solve it easily with initial props I have the same need because I am localizing my 404 page works fine otherwise, a 404 or a 500 is handled by the error.tsx, I don't see the point of trying to generate a 404 static page |
Beta Was this translation helpful? Give feedback.
-
Any updates on this? I'm getting the same error for /500 page |
Beta Was this translation helpful? Give feedback.
-
I have similar error on prod build. I don't like the fact that Next.js doesn't report any errors during dev and then when you try to compile for prod a lot of stuff breaks. If prod doesn't compile dev shouldn't compile too. |
Beta Was this translation helpful? Give feedback.
-
I am facing the same issue when in app router. I have a |
Beta Was this translation helpful? Give feedback.
-
I have similar error, but I don't even have error.tsx or any pages except for layout.tsx. App router, next 15.1.7 |
Beta Was this translation helpful? Give feedback.
-
The fix in my case was downgrading React to version 18 (was using 19) |
Beta Was this translation helpful? Give feedback.
-
I had this issue in a monorepo, with npm, nextjs 15.1.7 and 15.2 and react/react-dom ^19; dev worked but build failed. I was able to resolve this using
|
Beta Was this translation helpful? Give feedback.
-
In my case ( The simplest way to verify the value of
If the above command returns an empty string or a string equals to |
Beta Was this translation helpful? Give feedback.
I was able to solve it by changing the
getServierSideProps
function to