Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(nuxt): don't call renderMeta if it is not defined (#6201)
Browse files Browse the repository at this point in the history
* fix(nuxt): don't call renderMeta if it is not defined

* fix: check for nuxt existence as well
  • Loading branch information
danielroe committed Jul 28, 2022
1 parent 4e2667f commit 748b063
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/nuxt/src/core/runtime/nitro/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 748b063

Please sign in to comment.