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:
parent
cb312eb18b
commit
1496ad6299
|
@ -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) {
|
||||||
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/)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue