Commit 1496ad62 authored by Corentin.Andre's avatar Corentin.Andre Committed by Tim Neutkens

fix: update correct path to use when exporting 404 page (#5470)

When exporting error page, next defaults it to 404/index.html which is not recognized as a default 404 page.

This should fix https://github.com/zeit/next.js/issues/5035
parent cb312eb1
...@@ -38,7 +38,7 @@ export default async function (dir, options, configuration) { ...@@ -38,7 +38,7 @@ export default async function (dir, options, configuration) {
} }
if (page === '/_error') { if (page === '/_error') {
defaultPathMap['/404'] = { page } defaultPathMap['/404.html'] = { page }
continue continue
} }
......
...@@ -53,5 +53,10 @@ export default function (context) { ...@@ -53,5 +53,10 @@ export default function (context) {
const html = await renderViaHTTP(context.port, '/404') const html = await renderViaHTTP(context.port, '/404')
expect(html).toMatch(/404/) expect(html).toMatch(/404/)
}) })
it('should export 404.html instead of 404/index.html', async () => {
const html = await renderViaHTTP(context.port, '/404.html')
expect(html).toMatch(/404/)
})
}) })
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment