framework
framework copied to clipboard
v-text on custom component with slot work in SPA but not in SSR
Environment
nuxt3 lates linux
Reproduction
https://github.com/max5432112345/nuxt-error-2/
Describe the bug
If use v-text on custom component with slot when in SPA text is displayed in page but in SSR not displayed (hot reload only sometime make it to display but after refresh page disappear).
Index.vue
<template>
<div>
<CustomText v-text="'test'" />
<CustomText> TEST </CustomText>
</div>
</template>
CustomText.vue
<template>
<span>
<slot name="default" />
</span>
</template>
Additional context
No response
Logs
No response
In nuxt 2 it produced early warnings when used v-text without inner text (and I add $nbsp; to bypass that) but now no errors or warnings. Now in Nuxt 3 it not permit that to use inner text and v-text together.
In that situation it not show errors or warnings like nuxt 2:
Hydration children mismatch in
: server rendered element contains fewer child nodes than client vdom.
This sounds like an upstream Vue behaviour. Would you try to see if you can reproduce this on https://stackblitz.com/github/nuxt-contrib/vue3-ssr-starter/tree/main?terminal=dev ?
This sounds like an upstream Vue behaviour. Would you try to see if you can reproduce this on https://stackblitz.com/github/nuxt-contrib/vue3-ssr-starter/tree/main?terminal=dev ?
@danielroe like that https://stackblitz.com/edit/github-lf1exv?terminal=dev? The same problem. One time worked well only (hot update may be).
Thanks for your good work diagnosing! ❤️
Good to know where it's coming from. Check issues at https://github.com/vuejs/core and feel free to raise one there if you think it is a bug.
We certainly want behaviour similar on SSR vs SPA.
ok, thanks