https://github.com/mlsen/nuxt-apollo-report
No errors and data being loaded on the server (SSR)
It's giving me a warning
Mismatching childNodes vs. VNodes
and an error
The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.
The data is then fetched on the client again.
This only happens using the "apollo" object in my component, asyncData works fine.
I did some testing with different versions and it seems to be a problem only in 4.0.1, 4.0.0 works fine.
I can confirm the problem. SSR does not work with smart queries in 4.0.1 :(
Maybe related to this PR https://github.com/nuxt-community/apollo-module/pull/336
I'll check when I have time.
I am having the same issue. Downgrading to 4.0.0-rc.18 solves the issue for me.
4.0.1-rc.1 works as well
Downgrading works! Seems like people were facing the exact same issue 2 years ago as well: #125
Proposal to fix this issue with explanation why it is happening: https://github.com/nuxt-community/apollo-module/pull/362
I tried all versions mentioned above and all of them are still making a fetch a call on the server and on the client (with apollo object), causing this issue.
Tested versions:
4.0.0-rc184.0.1-rc.14.0.1-rc.34.0.1-rc.4hi there... we had the same issue, but we had a custom "globalName" value in the nuxt config. After commenting out this key in the nuxt config, we haven't seen the hydration error again... even with the newest version of nuxt-apollo
same issue here :/
So downgrading to the version you mentioned wasn't the only thing i had to do. I also had disabled caching in my query. So when I disabled it, it works.
So now that I enabled cache I also have an issue that when I change the query parameters, and then I change back to the previous parameters, it tries to load from the cache, but the v-for I use isn't really updated or something. Idk if the caching even works? But that is for another issue i think.
EDIT: nevermind, i solved it by calling this.$apollo.queries.myQuery.refresh() after updating the variables
Has "more work in this repo" been done already or was this closed by mistake? @pi0
Most helpful comment
I am having the same issue. Downgrading to
4.0.0-rc.18solves the issue for me.4.0.1-rc.1works as well