fix(nuxt): defer unsetting error handler until suspense resolves (#29037)

This commit is contained in:
Daniel Roe 2024-09-17 16:57:23 +02:00
parent 08891ab126
commit 04f1062af9
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B

View File

@ -67,6 +67,10 @@ if (import.meta.client) {
} }
vueApp.config.errorHandler = handleVueError vueApp.config.errorHandler = handleVueError
// If the errorHandler is not overridden by the user, we unset it after the app is hydrated
nuxt.hook('app:suspense:resolve', () => {
if (vueApp.config.errorHandler === handleVueError) { vueApp.config.errorHandler = undefined }
})
try { try {
await applyPlugins(nuxt, plugins) await applyPlugins(nuxt, plugins)
@ -84,9 +88,6 @@ if (import.meta.client) {
handleVueError(err) handleVueError(err)
} }
// If the errorHandler is not overridden by the user, we unset it
if (vueApp.config.errorHandler === handleVueError) { vueApp.config.errorHandler = undefined }
return vueApp return vueApp
} }