From 580d9bd4635a557c4993557333d05c942f917958 Mon Sep 17 00:00:00 2001 From: Michael Brevard Date: Thu, 11 Apr 2024 00:06:49 +0300 Subject: [PATCH] fix: import useNuxtApp and provide types --- .../nuxt/src/components/runtime/client-delayed-component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/components/runtime/client-delayed-component.ts b/packages/nuxt/src/components/runtime/client-delayed-component.ts index 24a6c5d65e..5ce547db56 100644 --- a/packages/nuxt/src/components/runtime/client-delayed-component.ts +++ b/packages/nuxt/src/components/runtime/client-delayed-component.ts @@ -3,6 +3,7 @@ import type { Component, Ref } from 'vue' // import ClientOnly from '#app/components/client-only' import { useObserver } from '#app/utils' import { getFragmentHTML } from '#app/components/utils' +import { useNuxtApp } from '#app/nuxt' /* @__NO_SIDE_EFFECTS__ */ export const createLazyIOClientPage = (componentLoader: Component) => { @@ -11,7 +12,7 @@ export const createLazyIOClientPage = (componentLoader: Component) => { setup (_, { attrs }) { const nuxt = useNuxtApp() const instance = getCurrentInstance()! - let vnode = null + let vnode: string | null = null if (import.meta.client && nuxt.isHydrating) { vnode = createStaticVNode(getFragmentHTML(instance.vnode.el), 1) } @@ -44,7 +45,7 @@ export const createLazyNetworkClientPage = (componentLoader: Component) => { setup (_, { attrs }) { const nuxt = useNuxtApp() const instance = getCurrentInstance()! - let vnode = null + let vnode: string | null = null if (import.meta.client && nuxt.isHydrating) { vnode = createStaticVNode(getFragmentHTML(instance.vnode.el), 1) }