mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
fix(nuxt): don't call renderMeta if it is not defined (#6201)
* fix(nuxt): don't call renderMeta if it is not defined * fix: check for nuxt existence as well
This commit is contained in:
parent
4e2667fcb7
commit
748b063afa
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user