From b1e66e5c05c70efad19d83ef160c63f387d85b74 Mon Sep 17 00:00:00 2001 From: Michael Brevard Date: Sun, 2 Jun 2024 17:13:03 +0300 Subject: [PATCH] fix: return component when server-side --- .../nuxt/src/components/runtime/client-delayed-component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/nuxt/src/components/runtime/client-delayed-component.ts b/packages/nuxt/src/components/runtime/client-delayed-component.ts index e5a17a9808..431aae4bb0 100644 --- a/packages/nuxt/src/components/runtime/client-delayed-component.ts +++ b/packages/nuxt/src/components/runtime/client-delayed-component.ts @@ -64,6 +64,11 @@ export const createLazyNetworkClientPage = (componentLoader: Component) => { return defineComponent({ inheritAttrs: false, setup (_, { attrs }) { + if (import.meta.server) { + return () => h('div', {}, [ + h(componentLoader, attrs), + ]) + } const nuxt = useNuxtApp() const instance = getCurrentInstance()! let vnode: VNode | null = null