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

Hydration mismatch when adding a class in the directive #11189

Closed
enkot opened this issue Jun 21, 2024 · 0 comments
Closed

Hydration mismatch when adding a class in the directive #11189

enkot opened this issue Jun 21, 2024 · 0 comments

Comments

@enkot
Copy link

enkot commented Jun 21, 2024

Vue version

3.4.29

Link to minimal reproduction

https://stackblitz.com/edit/github-npi9cl-n4gf8a?file=src%2Fmain.ts

Steps to reproduce

Start the dev server and open the page.

What is expected?

No "Hydration mismatch" warnings in the console

What is actually happening?

You will see the warning in the console:

entry-client.ts:6 [Vue warn]: Hydration class mismatch on <div class=​"test b-red">​Hello World!</div>​ 
  - rendered on server: class="test b-red"
  - expected on client: class="test"
  Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  You should fix the source of the mismatch. 
  at <App>

System Info

No response

Any additional comments?

Works fine in Vue 3.3.12 - https://stackblitz.com/edit/github-iswjxq-cp4swh?file=src%2Fmain.ts
props here https://github.com/vuejs/core/blame/main/packages/runtime-core/src/hydration.ts#/L462C29 never contains the class attribute modified inside the directive.

@enkot enkot changed the title Hydration mismatch when adding class in the directive Hydration mismatch when adding a class in the directive Jun 21, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant