fix(vue-app): add fallback context for error (#6854)

Co-Authored-By: Sébastien Chopin <seb@nuxtjs.com>
This commit is contained in:
Vladlen 2020-01-17 04:09:16 +11:00 committed by Pooya Parsa
parent e3ba6c290d
commit e91a441f2c

View File

@ -120,7 +120,10 @@ async function createApp (ssrContext) {
err = err || null
app.context._errored = Boolean(err)
err = err ? normalizeError(err) : null
const nuxt = this.nuxt || this.$options.nuxt
let nuxt = app.nuxt // to work with @vue/composition-api, see https://github.com/nuxt/nuxt.js/issues/6517#issuecomment-573280207
if (this) {
nuxt = this.nuxt || this.$options.nuxt
}
nuxt.dateErr = Date.now()
nuxt.err = err
// Used in src/server.js