fix(nuxt): log errors rendering islands (#24356)

This commit is contained in:
Julien Huang 2023-11-18 21:47:55 +01:00 committed by GitHub
parent c2b8adbb93
commit 7cce0ef6e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
import type { defineAsyncComponent } from 'vue' import type { defineAsyncComponent } from 'vue'
import { createVNode, defineComponent } from 'vue' import { createVNode, defineComponent, onErrorCaptured } from 'vue'
import { createError } from '../composables/error' import { createError } from '../composables/error'
@ -23,6 +23,10 @@ export default defineComponent({
}) })
} }
onErrorCaptured((e) => {
console.log(e)
})
return () => createVNode(component || 'span', { ...props.context.props, 'nuxt-ssr-component-uid': '' }) return () => createVNode(component || 'span', { ...props.context.props, 'nuxt-ssr-component-uid': '' })
} }
}) })