fix(nuxt): catch error in NuxtErrorBoundary with ssr: false (#24896)

This commit is contained in:
Julien Huang 2023-12-25 18:54:01 +01:00 committed by GitHub
parent c28ef02a17
commit 8ba118facb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ export default defineComponent({
const nuxtApp = useNuxtApp()
onErrorCaptured((err, target, info) => {
if (import.meta.client && !nuxtApp.isHydrating) {
if (import.meta.client && (!nuxtApp.isHydrating || !nuxtApp.payload.serverRendered)) {
emit('error', err)
nuxtApp.hooks.callHook('vue:error', err, target, info)
error.value = err