From 7cce0ef6e6e0733b5bdee368e8015d955623df19 Mon Sep 17 00:00:00 2001 From: Julien Huang Date: Sat, 18 Nov 2023 21:47:55 +0100 Subject: [PATCH] fix(nuxt): log errors rendering islands (#24356) --- packages/nuxt/src/app/components/island-renderer.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/app/components/island-renderer.ts b/packages/nuxt/src/app/components/island-renderer.ts index 62d83f1126..d973946be1 100644 --- a/packages/nuxt/src/app/components/island-renderer.ts +++ b/packages/nuxt/src/app/components/island-renderer.ts @@ -1,5 +1,5 @@ import type { defineAsyncComponent } from 'vue' -import { createVNode, defineComponent } from 'vue' +import { createVNode, defineComponent, onErrorCaptured } from 'vue' 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': '' }) } })