Skip to content

Commit

Permalink
fix(nuxt): useState in NuxtClientFallback setup function (#26928)
Browse files Browse the repository at this point in the history
  • Loading branch information
huang-julien committed Apr 27, 2024
1 parent e382045 commit 4544eaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/nuxt/src/app/components/client-fallback.server.ts
Expand Up @@ -41,9 +41,10 @@ const NuxtClientFallbackServer = defineComponent({
const vm = getCurrentInstance()
const ssrFailed = ref(false)
const nuxtApp = useNuxtApp()
const error = useState<boolean | undefined>(`${props.uid}`)

onErrorCaptured((err) => {
useState(`${props.uid}`, () => true)
error.value = true
ssrFailed.value = true
ctx.emit('ssr-error', err)
return false
Expand Down

0 comments on commit 4544eaf

Please sign in to comment.