refactor(vue-app): simplify mount error log (#5826)

* separately log mount error in dev mode
* simplify mount exception

Co-authored-by: Xin Du (Clark) <clark.duxin@gmail.com>
This commit is contained in:
Alexander Lichter 2019-05-30 15:28:37 +02:00 committed by Xin Du (Clark)
parent 0d5b49dcbc
commit 2e41bb47b5
1 changed files with 2 additions and 8 deletions

View File

@ -90,13 +90,7 @@ Vue.config.$nuxt.<%= globals.nuxt %> = true
const errorHandler = Vue.config.errorHandler || console.error
// Create and mount App
createApp()
.then(mountApp)
.catch((err) => {
const wrapperError = new Error(err)
wrapperError.message = '[nuxt] Error while mounting app: ' + wrapperError.message
errorHandler(wrapperError)
})
createApp().then(mountApp).catch(errorHandler)
function componentOption(component, key, ...args) {
if (!component || !component.options || !component.options[key]) {
@ -488,7 +482,7 @@ function showNextPage(to) {
// Will not update the instance data, so we have to update $data ourselves
function fixPrepatch(to, ___) {
if (this._pathChanged === false && this._queryChanged === false) return
const matches = []
const instances = getMatchedComponentsInstances(to, matches)
const Components = getMatchedComponents(to, matches)