Skip to content

Commit

Permalink
Remove /_errors/404 in favor of /404
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Feb 19, 2020
1 parent 940ecfa commit 63baa82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/next/build/index.ts
Expand Up @@ -725,7 +725,7 @@ export default async function build(dir: string, conf = null): Promise<void> {
}

if (useStatic404) {
await moveExportedPage('/_errors/404', '/_errors/404', false, 'html')
await moveExportedPage('/404', '/404', false, 'html')
}

for (const page of combinedPages) {
Expand Down
10 changes: 2 additions & 8 deletions packages/next/next-server/server/next-server.ts
Expand Up @@ -1174,14 +1174,8 @@ export default class Server {

// use static 404 page if available and is 404 response
if (is404) {
result = await this.findPageComponents('/_errors/404')

// use 404 if /_errors/404 isn't available which occurs
// during development and when _app has getInitialProps
if (!result) {
result = await this.findPageComponents('/404')
using404Page = result !== null
}
result = await this.findPageComponents('/404')
using404Page = result !== null
}

if (!result) {
Expand Down

0 comments on commit 63baa82

Please sign in to comment.