mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix: Show error page if error on layout
This commit is contained in:
parent
b9f3aa27c9
commit
bba9e2bae0
@ -123,6 +123,7 @@ export default async (ssrContext) => {
|
|||||||
let layout = Components.length ? Components[0].options.layout : NuxtError.layout
|
let layout = Components.length ? Components[0].options.layout : NuxtError.layout
|
||||||
if (typeof layout === 'function') layout = layout(app.context)
|
if (typeof layout === 'function') layout = layout(app.context)
|
||||||
await _app.loadLayout(layout)
|
await _app.loadLayout(layout)
|
||||||
|
if (ssrContext.nuxt.error) return renderErrorPage()
|
||||||
layout = _app.setLayout(layout)
|
layout = _app.setLayout(layout)
|
||||||
// ...Set layout to __NUXT__
|
// ...Set layout to __NUXT__
|
||||||
ssrContext.nuxt.layout = _app.layoutName
|
ssrContext.nuxt.layout = _app.layoutName
|
||||||
|
Loading…
Reference in New Issue
Block a user