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

[Bug Report][3.6.4] id Hydration mismatch #19696

Open
kingyue737 opened this issue Apr 26, 2024 · 2 comments
Open

[Bug Report][3.6.4] id Hydration mismatch #19696

kingyue737 opened this issue Apr 26, 2024 · 2 comments

Comments

@kingyue737
Copy link
Contributor

kingyue737 commented Apr 26, 2024

Environment

Vuetify Version: 3.6.4
Vue Version: 3.4.25
Browsers: Edge 124.0.0.0
OS: Windows 10

Steps to reproduce

mount a vuetify component with id or similar attribute

Expected Behavior

no warning

Actual Behavior

[Vue warn]: Hydration attribute mismatch on input#input-2.v-field__input 
  - rendered on server: id="input-2"
  - expected on client: id="input-0"

[Vue warn]: Hydration attribute mismatch on div#input-2-messages.v-messages 
  - rendered on server: id="input-2-messages"
  - expected on client: id="input-0-messages"

[Vue warn]: Hydration attribute mismatch on label.v-label.v-field-label.v-field-label--floating 
  - rendered on server: for="input-2"
  - expected on client: for="input-0"

Reproduction Link

https://stackblitz.com/edit/github-fi3r47-ntgp2l

@frederikheld
Copy link
Contributor

frederikheld commented May 7, 2024

Same issue here, also with form inputs.

As I could not find any information on how to fix this, I temporarily worked around it by putting the whole v-form into a v-no-ssr directive. But it's not ideal.

@kingyue737
Copy link
Contributor Author

@frederikheld my temporary workaround is filtering mismatch warning via warnHandler

for example

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.config.warnHandler = (msg, instance, info) => {
    if (
      msg.startsWith('Hydration attribute mismatch') &&
      (msg.includes('id="input') || msg.includes('for="input'))
    ) {
      return;
    }
    console.warn(msg, info);
  };
});

@kingyue737 kingyue737 changed the title [Bug Report][3.6.0-beta.0.0] id Hydration mismatch [Bug Report][3.6.4] id Hydration mismatch May 8, 2024
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