From 22380dfe2aee2181144048d0deb8d0e1ae077a34 Mon Sep 17 00:00:00 2001 From: Michael Novotny Date: Tue, 26 Sep 2023 14:32:06 -0500 Subject: [PATCH] Updates "Prerender Error" page for App Router (#56044) I am open to alternative ideas on how to solve this. Fixes https://github.com/vercel/feedback/issues/40502 --- errors/prerender-error.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/errors/prerender-error.mdx b/errors/prerender-error.mdx index e7cc905958a63..16273126277ca 100644 --- a/errors/prerender-error.mdx +++ b/errors/prerender-error.mdx @@ -8,6 +8,7 @@ While prerendering a page an error occurred. This can occur for many reasons fro ## Possible Ways to Fix It +- Use Next.js 13 (or higher) and the [App Router](/docs#app-router-vs-pages-router), which allows [colocation](/docs/app/building-your-application/routing#colocation) of pages and other files (e.g. components, styles, tests, etc) - Make sure to move any non-pages out of the `pages` folder - Check for any code that assumes a prop is available, even when it might not be - Set default values for all dynamic pages' props (avoid `undefined`, use `null` instead so it can be serialized)