1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

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
This commit is contained in:
Corentin.Andre 2018-11-03 01:19:41 +01:00 committed by Tim Neutkens
parent cb312eb18b
commit 1496ad6299
2 changed files with 6 additions and 1 deletions

View file

@ -38,7 +38,7 @@ export default async function (dir, options, configuration) {
}
if (page === '/_error') {
defaultPathMap['/404'] = { page }
defaultPathMap['/404.html'] = { page }
continue
}

View file

@ -53,5 +53,10 @@ export default function (context) {
const html = await renderViaHTTP(context.port, '/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/)
})
})
}