Skip to content

Commit 8731ba4

Browse files
committed
skip rm not-found file
1 parent 8912a29 commit 8731ba4

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

packages/next/src/export/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -813,9 +813,6 @@ async function exportAppImpl(
813813
await fs.mkdir(dirname(htmlDest404Index), { recursive: true })
814814
await fs.copyFile(htmlSrc, htmlDest404Index)
815815
}
816-
if (!options.buildExport) {
817-
await fs.rm(htmlSrc)
818-
}
819816
}
820817
// Skip 500.html in static export
821818
if (unnormalizedRoute === '/_global-error') {

test/e2e/app-dir/actions-unrecognized/actions-unrecognized.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,16 @@ describe('unrecognized server actions', () => {
159159
// FIXME: Currently, an unrecognized id in an MPA action results in a 500.
160160
// This is not ideal, and ignores all nested `error.js` files, only showing the topmost one.
161161
expect(response.status()).toBe(500)
162-
expect(response.headers()['content-type']).toStartWith('text/plain')
163-
expect(await response.text()).toBe('Internal Server Error')
162+
if (isNextDev) {
163+
expect(response.headers()['content-type']).toStartWith(
164+
'text/html'
165+
)
166+
} else {
167+
expect(response.headers()['content-type']).toStartWith(
168+
'text/plain'
169+
)
170+
expect(await response.text()).toBe('Internal Server Error')
171+
}
164172
// In dev, the 500 page doesn't have any SSR'd html, so it won't show anything without JS.
165173
if (!isNextDev) {
166174
expect(await browser.elementByCss('body').text()).toContain(

test/integration/app-dir-export/test/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export const expectedWhenTrailingSlashTrue = [
4242
? ['_next/static/test-build-id/_clientMiddlewareManifest.json']
4343
: []),
4444
'_next/static/test-build-id/_ssgManifest.js',
45+
'_not-found/index.html',
46+
'_not-found/index.txt',
4547
'another/first/index.html',
4648
'another/first/index.txt',
4749
'another/index.html',

0 commit comments

Comments
 (0)