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

Attributes are not updated on the client side (hydration issue 🤔) #14143

Closed
ilyasmez opened this issue Jun 10, 2022 · 1 comment
Closed

Attributes are not updated on the client side (hydration issue 🤔) #14143

ilyasmez opened this issue Jun 10, 2022 · 1 comment

Comments

@ilyasmez
Copy link

Environment

  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-rc.3
  • Package Manager: npm@7.17.0
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-fqaqgt?file=app.vue,package.json

Describe the bug

Seems like Nuxt doesn't update the attributes when mounted on the client side.
In the repro above you can see that the text node is updated to match the right value on the client side (isClient = true), while the attribute (you can to inspect the div), says false.

Additional context

Using Vue Devtools, I can see that Vue is detecting the right value. But seems like Nuxt is just not updating the DOM for the attribute.

Logs

No response

@danielroe
Copy link
Member

You are changing the value before hydration which is technically a hydration mismatch. However, Vue is generous when it comes to attributes and does not throw an error.

You should ensure that your component state matches between client/server, until initial hydration takes place. Example.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Jun 10, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants