fix: Server Side Exception has occurred while loading the localhost #1473#1475
fix: Server Side Exception has occurred while loading the localhost #1473#1475samandeepbishnoi wants to merge 2 commits intovercel:mainfrom
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/catchor error boundaries in React.getCart()does not handle failed fetches or missing cart data.SHOPIFY_GRAPHQL_API_ENDPOINTwas 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/catchblock to prevent layout crashes.throw {}inshopifyFetch()with standardErrorinstances for compatibility with error boundaries.endpointis constructed correctly using the full store domain and versioned API path..env.exampleto includeSHOPIFY_STOREFRONT_API_VERSION.🧪 Verification
npm run devworks with correct.env.localsetupundefinedif invalid or missing