Closed JBustin closed 3 years ago
Hello @JBustin ! I highly recommend you to not do stuff like <component :is="isMobile ? 'HeaderMainNavMobilePanel' : 'HeaderMainNavPanel'>
with Nuxt! If SSR HTML does not match client-side rendered HTML you're heading for trouble.
Make sure SSR HTML does always match client HTML 100%!
Hello,
I use nuxtjs v2.14.3 as universal and the latest beta version of vue-lazy-hydration. I have a hidden navigation tool that I hydrate only when the tool is opened for the first time (ssr-only + trigger-hydration). It works as expected for no-mobile, but not for my mobile version (responsive). Notice that nuxtjs generates the mobile version.
To be more precise, mobile and desktop are two different lazy components, called by dynamic component syntax:
My problem is resolved by commenting this line: https://github.com/maoberlehner/vue-lazy-hydration/blob/master/src/LazyHydrate.js#L160
I'm surprising because:
console.log
to inspect thethis.$elt
here, it is effectively an empty div - but only a few times, if I logthis
and I inspect it, there are some childrens ($elt inthis
as reference has been updated)trigger-hydration
condition istrue
)Does someone have an explanation, a trick, any idea ?
Regards