fix(nuxt): avoid early returning renderer with empty response (#21439)

This commit is contained in:
pooya parsa 2023-06-07 15:11:59 +02:00 committed by GitHub
parent f5e65171a2
commit 05f3decfa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View File

@ -259,11 +259,6 @@ export default defineRenderHandler(async (event): Promise<Partial<RenderResponse
if (ssrContext._renderResponse) { return ssrContext._renderResponse }
if (event.node.res.headersSent || event.node.res.writableEnded) {
// @ts-expect-error TODO: handle additional cases
return
}
// Handle errors
if (ssrContext.payload?.error && !ssrError) {
throw ssrContext.payload.error

View File

@ -45,7 +45,7 @@ describe.skipIf(isWindows || process.env.TEST_BUILDER === 'webpack' || process.e
it('default server bundle size', async () => {
stats.server = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
expect(roundToKilobytes(stats.server.totalBytes)).toMatchInlineSnapshot('"62.8k"')
expect(roundToKilobytes(stats.server.totalBytes)).toMatchInlineSnapshot('"62.7k"')
const modules = await analyzeSizes('node_modules/**/*', serverDir)
expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2286k"')