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 committed by GitHub
parent 215ae69192
commit 5faf720b42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,6 +67,10 @@ if (import.meta.client) {
}
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 {
await applyPlugins(nuxt, plugins)
@ -84,9 +88,6 @@ if (import.meta.client) {
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
}