-
Notifications
You must be signed in to change notification settings - Fork 5.1k
fix: Server Side Exception has occurred while loading the localhost #1473 #1475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: Server Side Exception has occurred while loading the localhost #1473 #1475
Conversation
Someone is attempting to deploy a commit to the Vercel Solutions Team on Vercel. A member of the Team first needs to authorize it. |
Hi team 👋, This is my first open-source contribution — I fixed a Shopify layout crash caused by unhandled API errors and misconfigured endpoint logic. The PR ensures proper error handling in Would love a review or feedback — happy to make changes! 🙌 Thanks for maintaining this amazing project 🚀 |
…ing in shopifyFetch
Thank you for the detailed review! 🙏 Removed package-lock.json as the repo uses pnpm. Updated .env.example with SHOPIFY_STOREFRONT_API_VERSION=2025-07 as per latest docs. Fixed the extra tabbing headers in shopifyFetch(). |
+1 this helped fix my problem |
Problem
When running the project locally with Shopify as the provider, a server-side exception crashes the app during layout rendering
Root cause:
shopifyFetch()
throws a non-standard object (throw {}
), which cannot be caught bytry/catch
or error boundaries in React.getCart()
does not handle failed fetches or missing cart data.SHOPIFY_GRAPHQL_API_ENDPOINT
was used as a relative path, which breaks SSR fetch requests if environment variables are not configured properly.✅ What This PR Fixes
getCart()
logic in atry/catch
block to prevent layout crashes.throw {}
inshopifyFetch()
with standardError
instances for compatibility with error boundaries.endpoint
is constructed correctly using the full store domain and versioned API path..env.example
to includeSHOPIFY_STOREFRONT_API_VERSION
.🧪 Verification
npm run dev
works with correct.env.local
setupundefined
if invalid or missing