vuejs / vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
http://v2.vuejs.org
MIT License
207.7k stars 33.67k forks source link

Strange ssr behavior in v-for loop with if-else and v-text #11771

Open TrueCarry opened 3 years ago

TrueCarry commented 3 years ago

Version

2.6.11

Reproduction link

https://github.com/TrueCarry/linktest

Steps to reproduce

Run server, open localhost:8080. Problem is in components/textWrapper.vue file. I've used some vue ssr template and removed almost everything unneeded. Same error as before.

What is expected?

ssr and client side versions are the same. It works if we don't use v-text on span. I changed it to v-text1, to test. No hydration errors with v-text1 image

What is actually happening?

Server doesn't render custom element. Console output: image Server generated html: image


Can you give me few hours to respond next time you decide to close issue please?

posva commented 3 years ago

As a workaround, you can avoid v-text.

Can you give me few hours to respond next time you decide to close issue please?

Read https://new-issue.vuejs.org/?repo=vuejs/vue#why-repro

4eveRS commented 3 years ago

Any updates?

sirlancelot commented 3 years ago

Replace your <span v-text="val" /> with <span>{{ val }}</span>.