ndimatteo / HULL

💀 Headless Shopify Starter – powered by Next.js + Sanity.io
https://hull.dev
MIT License
1.38k stars 173 forks source link

Error: "Unavailable Shop" in dev after changing to a new Shop URL in env variables #100

Closed ansmlc closed 2 years ago

ansmlc commented 2 years ago

When running npm run dev I get this error after the site is compiled. Only happens locally. When deployed to production (Vercel), there is no error.

This started happening after I switched the a different Shopify Shop. I changed all the .env.local. accordingly. It seems like the live Vercel build is recognizing the new env variables, while locally it still tries to use the old Shop URL, which is no longer available.

image

Unhandled Runtime Error
Error: "Unavailable Shop"

Call Stack
eval
node_modules\shopify-buy\index.js (3847:0)

When looking in DevTools, console tab, I get this: XXXXX is the OLD Shopify Shop name, even though I changed it in .env.local.

POST https://XXXXX.myshopify.com/api/2022-01/graphql 402
Uncaught (in promise) Error: "Unavailable Shop"
    at eval (index.js?c443:3847:1)

When looking at the live URL on Vercel, it shows the new Shopify URL as it shoul.

ansmlc commented 2 years ago

My mistake. I had two different instances of HULL running locally.

ndimatteo commented 2 years ago

Glad you were able to figure it out! I've been there!