Hydrogen/Sanity connect chokes on GraphQL query with products, fixed in latest plugin version
21 replies
Last updated: Apr 26, 2022
K
spun up my own very simple example of hydrogen/sanity connect and when trying to query my home page with some modules + products it suddenly chokes, and very specifically if a module has products in it:
Cannot destructure property 'data' of '__vite_ssr_import_3__.useSkippableShopQuery(...)' as it is undefined. TypeError: Cannot destructure property 'data' of '__vite_ssr_import_3__.useSkippableShopQuery(...)' as it is undefined. at Module.useSanityShopifyProducts [as default] (/node_modules/hydrogen-plugin-sanity/dist/useSanityShopifyProducts.js:57:19) at Module.useSanityQuery (/node_modules/hydrogen-plugin-sanity/dist/useSanityQuery.js:59:58)
Apr 23, 2022, 10:31 PM
K
removing the products all it is fetched just fine
Apr 23, 2022, 10:32 PM
K
is this… a grapqQL issue?
Apr 23, 2022, 10:33 PM
E
Thanks for reporting
user G
- we’ll look into it. I know some things have changed recently in Hydrogen that might cause this.Apr 23, 2022, 10:33 PM
K
it’s been pretty smooth sailing otherwise though, hydrogen sites are absolutely in my future
Apr 23, 2022, 10:34 PM
E
We look for products and then forward a chunked request to the graphql endpoints in Shopify to get updated inventory. So it's never stale.
Apr 23, 2022, 10:36 PM
E
Could this be the culprit? https://github.com/Shopify/hydrogen/pull/878#pullrequestreview-908809703
Apr 23, 2022, 10:37 PM
E
Do give word if you've got requests for the sync app!
Apr 23, 2022, 10:39 PM
K
mmm it’s possible I’m out dated
Apr 23, 2022, 11:01 PM
K
let me try and update hydrogen
Apr 23, 2022, 11:01 PM
E
I think we might be behind actually - lmk how it goes
Apr 23, 2022, 11:01 PM
K
so y’all are also hitting shopify with your product request then
Apr 23, 2022, 11:02 PM
E
We are - to make sure that you're not getting anything that's not been updated. Do you think it's makes sense?
Apr 23, 2022, 11:03 PM
K
i guess because this is server rendered that’s a nice bonus
Apr 23, 2022, 11:09 PM
K
i usually double dip that because i’m used to static rendering everything
Apr 23, 2022, 11:09 PM
E
We’ll be doing more work on this so appreciate any feedback
Apr 23, 2022, 11:10 PM
K
I'm playing with y'all's package directly but a lil out of my depths, will PR it if I fix it on my side
Apr 24, 2022, 1:02 AM
E
Will let you know when we find time to pick this up
Apr 25, 2022, 7:48 AM
K
It was on 0.13 but it's happening in the latest too. I haven't actually tried to render data into a pdp yet, just a reference on the home page
Apr 25, 2022, 2:00 PM
R
Thanks! We’ll be bringing in upstream changes into both the demo and plugin real shortly (it was last stable around
~0.11and there’s been a bunch of breaking changes since).
Apr 25, 2022, 2:03 PM
R
user G
this is now fixed in 0.4.0of the plugin and should work in all currently known versions of Hydrogen
>= 0.13.0
(There was a breaking change introduced in Hydrogen
0.13.0)
Apr 26, 2022, 10:49 AM
K
luckily this is a test site i am making for my gf, the stability of hydrogen seems not there lol
Apr 26, 2022, 2:49 PM
Sanity– build remarkable experiences at scale
Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.