diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts index 28eb2ae885..b046437ec0 100644 --- a/packages/nuxt/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts @@ -146,9 +146,9 @@ export default eventHandler(async (event) => { } // Render meta - const renderedMeta = await ssrContext.renderMeta() + const renderedMeta = await ssrContext.renderMeta?.() ?? {} - // Create render conrtext + // Create render context const rendered: NuxtRenderContext = { ssrContext, html: { @@ -178,7 +178,7 @@ export default eventHandler(async (event) => { // Allow hooking into the rendered result const nitroApp = useNitroApp() - await ssrContext.nuxt.hooks.callHook('app:rendered', rendered) + await ssrContext.nuxt?.hooks.callHook('app:rendered', rendered) await nitroApp.hooks.callHook('nuxt:app:rendered', rendered) // Construct HTML response