Skip to content

Commit 2e41bb4

Browse files
refactor(vue-app): simplify mount error log (nuxt#5826)
* separately log mount error in dev mode * simplify mount exception Co-authored-by: Xin Du (Clark) <clark.duxin@gmail.com>
1 parent 0d5b49d commit 2e41bb4

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

packages/vue-app/template/client.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,7 @@ Vue.config.$nuxt.<%= globals.nuxt %> = true
9090
const errorHandler = Vue.config.errorHandler || console.error
9191

9292
// Create and mount App
93-
createApp()
94-
.then(mountApp)
95-
.catch((err) => {
96-
const wrapperError = new Error(err)
97-
wrapperError.message = '[nuxt] Error while mounting app: ' + wrapperError.message
98-
errorHandler(wrapperError)
99-
})
93+
createApp().then(mountApp).catch(errorHandler)
10094

10195
function componentOption(component, key, ...args) {
10296
if (!component || !component.options || !component.options[key]) {
@@ -488,7 +482,7 @@ function showNextPage(to) {
488482
// Will not update the instance data, so we have to update $data ourselves
489483
function fixPrepatch(to, ___) {
490484
if (this._pathChanged === false && this._queryChanged === false) return
491-
485+
492486
const matches = []
493487
const instances = getMatchedComponentsInstances(to, matches)
494488
const Components = getMatchedComponents(to, matches)

0 commit comments

Comments
 (0)