Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(tsx) Vue SSR hydration error (defineComponent) #11771

Closed
ElYaiko opened this issue Sep 2, 2024 · 2 comments · Fixed by #11772
Closed

(tsx) Vue SSR hydration error (defineComponent) #11771

ElYaiko opened this issue Sep 2, 2024 · 2 comments · Fixed by #11772
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working scope: ssr

Comments

@ElYaiko
Copy link

ElYaiko commented Sep 2, 2024

Vue version

3.4.38

Link to minimal reproduction

https://stackblitz.com/edit/github-wvhf41?file=app.tsx

Steps to reproduce

  • Create a TSX component
  • Return a text concated with a ref (App 2: {a.value}<br/>)

What is expected?

To render the line

What is actually happening?

runtime-core.esm-bundler.js?v=17134382:50 [Vue warn]: Hydration text mismatch in <div id=​"app">​…​</div>​ 
  - rendered on server: "App 2: 0"
  - expected on client: "App 2: " 
  at <Anonymous key=4 > 
  at <NuxtRoot>

System Info

No response

Any additional comments?

You can see the text App 1 is rendered with the ref but App 2 not.
Related:
vuejs/babel-plugin-jsx#568
#7285

@edison1105 edison1105 added 🐞 bug Something isn't working scope: ssr labels Sep 2, 2024
@edison1105
Copy link
Member

a workaround

<div id="app">
  {`App 1: ${String(a.value)}`}
  <br />
  App 2: {String(a.value)}
  <br />
</div>

@edison1105 edison1105 added the has workaround A workaround has been found to avoid the problem label Sep 2, 2024
@ElYaiko
Copy link
Author

ElYaiko commented Sep 2, 2024

a workaround

<div id="app">
  {`App 1: ${String(a.value)}`}
  <br />
  App 2: {String(a.value)}
  <br />
</div>

That worked, but I don't think is a good DX...

@edison1105 edison1105 added the 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. label Sep 2, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working scope: ssr
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants