From 4544eaf228b4a84b8423f01301fb7efc56698f54 Mon Sep 17 00:00:00 2001 From: Julien Huang Date: Sat, 27 Apr 2024 22:01:09 +0200 Subject: [PATCH] fix(nuxt): `useState` in `NuxtClientFallback` setup function (#26928) --- packages/nuxt/src/app/components/client-fallback.server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/app/components/client-fallback.server.ts b/packages/nuxt/src/app/components/client-fallback.server.ts index 4e8dfe864c..c1bc3c3e02 100644 --- a/packages/nuxt/src/app/components/client-fallback.server.ts +++ b/packages/nuxt/src/app/components/client-fallback.server.ts @@ -41,9 +41,10 @@ const NuxtClientFallbackServer = defineComponent({ const vm = getCurrentInstance() const ssrFailed = ref(false) const nuxtApp = useNuxtApp() + const error = useState(`${props.uid}`) onErrorCaptured((err) => { - useState(`${props.uid}`, () => true) + error.value = true ssrFailed.value = true ctx.emit('ssr-error', err) return false