[Vue warn]: Hydration node mismatch:
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v14.18.1
- Nuxt Version:
3.0.0-27243104.5e903ae
- Package Manager:
Yarn
- Bundler:
Vite
- User Config:
meta
,buildModules
- Runtime Modules:
-
- Build Modules:
nuxt-windicss@2.0.2
Describe the bug
A warning occurs in console when i add a @click
attribute in html tag
[Vue warn]: Hydration node mismatch:
- Client vnode: i
- Server rendered DOM: <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
at <Navbar>
at <AsyncComponentWrapper>
at <Default name="default" >
at <AsyncComponentWrapper name="default" >
at <NuxtLayout key=0 name=undefined >
at <RouterView>
at <NuxtPage>
at <App>
at <Root>
Reproduction
.
Additional context
<template>
...
<a @click="menu"><i data-feather="menu"></i></a>
</template>
<script setup>
const menu = () => {
console.log('menu')
}
</script>
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Understand and solve hydration errors in Vue.js - sum.cumo
HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node ... Hydration refers to the client-side process during which Vue ...
Read more >Should I ignore these kind of warnings? "Hydration node ...
"Hydration node mismatch". I am using this package "FormKit" for handling forms and validation. it shows this warning for every element I ...
Read more >How to fix hydration node mismatch error? - Stack Overflow
I'm trying to hide a button text when a page width is less than 420px. To achieve my goal I created a composable...
Read more >Hydration Mismatch - vite-plugin-ssr
A hydration mismatch is when the content rendered to HTML in Node.js is not the same than the content rendered in the browser....
Read more >What to do when Vue hydration fails - Alexander Lichter's blog
js:1:16358 Mismatching childNodes vs. VNodes: NodeList(3) [ p, p, p ] Array [ {…} ] [Vue warn]: The client-side rendered virtual DOM ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Trying to wrap my head around this…:
Which probably stems from a problem with my if/else, as the form referenced up top is the form shown if
isAuthenticated()
fails:useAuth.ts
whereby
userSession
is set bysupabase.auth
, and a subsequent request to/api/auth
ensures that a cookie is being set so that Nuxt’s API can make requests to supabase on behalf of the user. Full repo: https://github.com/henningko/briefxyz/tree/api New to Nuxt3/SSR/Supabase and biting off more than I can chew, probably, so please don’t hold back with criticism 😃Environment
macOS
v17.4.0
3.0.0-27398533.8edd481
Yarn
Vite
buildModules
,RuntimeConfig
-
nuxt-windicss@2.2.2
If you want to use the whole feather-icons package, I think it’s easiest to implement a component which renders the icon to SVG, like so:
which could be used as follows
see https://codesandbox.io/s/happy-kare-hoy65?file=/src/components/FeatherIcon.vue:0-536
There are also other packages like vue-feather, but IMHO those packages often provide features which are not always required in every project…