Hydrogen/Sanity connect chokes on GraphQL query with products, fixed in latest plugin version

21 replies
Last updated: Apr 26, 2022
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
removing the products all it is fetched just fine
Apr 23, 2022, 10:32 PM
is this… a grapqQL issue?
Apr 23, 2022, 10:33 PM
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
it’s been pretty smooth sailing otherwise though, hydrogen sites are absolutely in my future
Apr 23, 2022, 10:34 PM
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
Apr 23, 2022, 10:37 PM
Do give word if you've got requests for the sync app!
Apr 23, 2022, 10:39 PM
mmm it’s possible I’m out dated
Apr 23, 2022, 11:01 PM
let me try and update hydrogen
Apr 23, 2022, 11:01 PM
I think we might be behind actually - lmk how it goes
Apr 23, 2022, 11:01 PM
so y’all are also hitting shopify with your product request then
Apr 23, 2022, 11:02 PM
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
i guess because this is server rendered that’s a nice bonus
Apr 23, 2022, 11:09 PM
i usually double dip that because i’m used to static rendering everything
Apr 23, 2022, 11:09 PM
We’ll be doing more work on this so appreciate any feedback
Apr 23, 2022, 11:10 PM
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
Will let you know when we find time to pick this up
Apr 25, 2022, 7:48 AM
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
Thanks! We’ll be bringing in upstream changes into both the demo and plugin real shortly (it was last stable around
~0.11
and there’s been a bunch of breaking changes since).
Apr 25, 2022, 2:03 PM
user G
this is now fixed in
0.4.0
of 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
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.

Was this answer helpful?