Replies: 1 comment
-
Can you provide an example for us to look at? Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I am trying to upgrade a client's custom storefront to the new hydrogen-react version, but I'm facing an issue with the
useCart
hook. Whenever I try to add anything to cart withlinesAdd
I get an error in the console:cart-hooks.mjs:27
POST http://localhost:3000/editor/[my-shop].myshopify.com/api/2023-01/graphql.json 404 (Not Found)
This tells me that
useCart
is fetching the wrong URL. However when I looked at the implementation incart-hooks.mjs
the fetch URL seems to be coming from auseShop
hook, which if I call from the client, it returns the valid api URL fromgetStorefrontApiUrl
. So why isuseCart
prepending the current window location to the api URL?Beta Was this translation helpful? Give feedback.
All reactions