diff --git a/packages/nuxt/src/app/entry.ts b/packages/nuxt/src/app/entry.ts index 7f29843c8c..dac40f4b97 100644 --- a/packages/nuxt/src/app/entry.ts +++ b/packages/nuxt/src/app/entry.ts @@ -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 }