mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +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
|
// Render meta
|
||||||
const renderedMeta = await ssrContext.renderMeta()
|
const renderedMeta = await ssrContext.renderMeta?.() ?? {}
|
||||||
|
|
||||||
// Create render conrtext
|
// Create render context
|
||||||
const rendered: NuxtRenderContext = {
|
const rendered: NuxtRenderContext = {
|
||||||
ssrContext,
|
ssrContext,
|
||||||
html: {
|
html: {
|
||||||
@ -178,7 +178,7 @@ export default eventHandler(async (event) => {
|
|||||||
|
|
||||||
// Allow hooking into the rendered result
|
// Allow hooking into the rendered result
|
||||||
const nitroApp = useNitroApp()
|
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)
|
await nitroApp.hooks.callHook('nuxt:app:rendered', rendered)
|
||||||
|
|
||||||
// Construct HTML response
|
// Construct HTML response
|
||||||
|
Loading…
Reference in New Issue
Block a user