mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
fix(nuxt): avoid early returning renderer with empty response (#21439)
This commit is contained in:
parent
f5e65171a2
commit
05f3decfa9
@ -259,11 +259,6 @@ export default defineRenderHandler(async (event): Promise<Partial<RenderResponse
|
|||||||
|
|
||||||
if (ssrContext._renderResponse) { return ssrContext._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
|
// Handle errors
|
||||||
if (ssrContext.payload?.error && !ssrError) {
|
if (ssrContext.payload?.error && !ssrError) {
|
||||||
throw ssrContext.payload.error
|
throw ssrContext.payload.error
|
||||||
|
@ -45,7 +45,7 @@ describe.skipIf(isWindows || process.env.TEST_BUILDER === 'webpack' || process.e
|
|||||||
|
|
||||||
it('default server bundle size', async () => {
|
it('default server bundle size', async () => {
|
||||||
stats.server = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
|
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)
|
const modules = await analyzeSizes('node_modules/**/*', serverDir)
|
||||||
expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2286k"')
|
expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2286k"')
|
||||||
|
Loading…
Reference in New Issue
Block a user