From 2e41bb47b50aa76d4e1e43da36120634a5037c7e Mon Sep 17 00:00:00 2001 From: Alexander Lichter Date: Thu, 30 May 2019 15:28:37 +0200 Subject: [PATCH] refactor(vue-app): simplify mount error log (#5826) * separately log mount error in dev mode * simplify mount exception Co-authored-by: Xin Du (Clark) --- packages/vue-app/template/client.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/vue-app/template/client.js b/packages/vue-app/template/client.js index df9eefd26b..91f20e6725 100644 --- a/packages/vue-app/template/client.js +++ b/packages/vue-app/template/client.js @@ -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)