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 in Nuxt app after updating Oruga from 0.7 to 0.8.x #860

Open
andrzejkupczyk opened this issue Mar 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@andrzejkupczyk
Copy link
Contributor

andrzejkupczyk commented Mar 24, 2024

Overview of the problem

Oruga version: 0.8.6
Vuejs version: 3.4.21
OS/Browser: macOS/Chrome

Description

I'm encountering a hydration mismatch issue with the Autocomplete component while upgrading my Nuxt 3.11.1 app from Oruga version 0.7 to 0.8.6.

image

I have noticed similar problem reports in vue and nuxt before, but afaik, those problems have been fixed. This issue does not impact other components in Oruga, and it functions properly in Oruga 0.7 version. Hence, I wanted to report the issue here.

Expected behavior

The autocomplete component has the same id on both the server and client side.

Actual behavior

The Autocomplete component on the client side receives a different ID, causing a mismatch in the hydration attribute.

@andrzejkupczyk andrzejkupczyk changed the title Hydration mismatch in Nuxt app after updating Oruga from 0.7 to 0.8.x affecting Autocomplete component Hydration mismatch in Nuxt app after updating Oruga from 0.7 to 0.8.x Mar 24, 2024
@andrzejkupczyk
Copy link
Contributor Author

andrzejkupczyk commented Mar 24, 2024

I'm not sure if this will be helpful, but I came across this information: https://www.radix-vue.com/utilities/config-provider.html#hydration-issue-vue-3-5
I am unfamiliar with this framework, but it appears that the problem is comparable (link to the PR).

@mlmoravek mlmoravek added the bug Something isn't working label Mar 24, 2024
@mlmoravek
Copy link
Member

Ok, so I have just learnt a bit. With nuxt the script is executed twice, once on the server and once on the client. However, in our case the id is generated randomly. So there will be a different id generated on the server then on the client.

But we have to wait some more time. A vue native useId composable is confirmed for vue 3.5 which should solve this problem.
vuejs/rfcs#557

@andrzejkupczyk
Copy link
Contributor Author

The reason the radix-vue authors referred to their solution as a temporary workaround is now clear. Thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants