-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consistently use /_not-found for not found page in App Router #62679
Consistently use /_not-found for not found page in App Router #62679
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @timneutkens and the rest of your teammates on Graphite |
Failing test suitesCommit: a9628b8
Expand output● next.rs api › should detect the correct routes
Read more about building and testing Next.js in contributing.md. |
Stats from current PRDefault BuildGeneral
Client Bundles (main, webpack)
Legacy Client Bundles (polyfills)
Client Pages
Client Build Manifests
Rendered Page Sizes
Edge SSR bundle Size
Middleware size
Next Runtimes
build cache
Diff detailsDiff for middleware.jsDiff too large to display Diff for edge-ssr.jsDiff too large to display Diff for 2453-HASH.jsDiff too large to display Diff for main-HASH.jsDiff too large to display Diff for app-page-exp..ntime.dev.jsDiff too large to display Diff for app-page-exp..time.prod.jsDiff too large to display Diff for app-page-tur..time.prod.jsDiff too large to display Diff for app-page-tur..time.prod.jsDiff too large to display Diff for app-page.runtime.dev.jsDiff too large to display Diff for app-page.runtime.prod.jsDiff too large to display Diff for server.runtime.prod.jsDiff too large to display |
@@ -41,6 +41,7 @@ export async function exportAppPage( | |||
fileWriter: FileWriter | |||
): Promise<ExportRouteResult> { | |||
// If the page is `/_not-found`, then we should update the page to be `/404`. | |||
// UNDERSCORE_NOT_FOUND_ROUTE value used here, however we don't want to import it here as it causes constants to be inlined which we don't want here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably separate this into some other file to keep the bundle small later. not blocking
What?
#62528 caused test/e2e/app-dir/not-found/conflict-route to fail compilation in Turbopack, this compiler error was previously already reported by Turbopack but Next.js didn't show it, which #62528 resolved.
This PR changes the handling for the not-found handling to be consistent between development and build, which ensures that the "special" page no longer conflicts with app/not-found/page.js.
Closes NEXT-2617
Note: this is a reworked iteration of #62585 which wasn't sufficient.