-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Nuxt3 Swiper hydration issue #6634
Comments
The same issue happens in next.js aswell. So it's not framework related. https://stackblitz.com/edit/nextjs-k3yjfv?file=pages/index.js |
hmmm this might be a deeper issue around vue and the compatibility of web components. |
Hello. I had the same problem and I found a solution. You need to add attribute |
That doesn't seem like a fix and more like a workaround to me. I will try it anyways. Thanks for the suggestion! |
@alexovn : How to initialize, could you share the code please? |
Okey. You have several ways how to deal with it. First approach, just to use all swiper params and methods in the template. It seems that it works well now. Just check swiper docu. Second approach, do swiper init in onMounted hook: *** NUXT 3 ***
|
Simply add the components to export default defineNuxtConfig({
vue: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('swiper-'),
},
},
}) |
Check that this is really a bug
Reproduction link
https://stackblitz.com/edit/nuxt-starter-y6fay4
Bug description
Ther's a hydration issue with a very simple implementation of the swiper in nuxt 3.
Check the console for the error
and
I know it's a framework specific error but imo it makes more sense to place it here. If I should post first in the nuxt issues, I will do that.
Expected Behavior
No response
Actual Behavior
No response
Swiper version
9.2.4
Platform/Target and Browser Versions
nuxt 3
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: