mirror of
https://github.com/vercel/commerce.git
synced 2025-06-05 07:46:58 +00:00
Resolves a prerendering error for the `/_not-found` page caused by the Navbar's attempt to fetch a menu that might not exist in the build environment (e.g., 'next-js-frontend-header-menu'). The `getMenu` function in `lib/shopify/index.ts` has been updated to catch errors thrown by `shopifyFetch` (such as when the Shopify API returns an error for a non-existent menu handle). If an error occurs during menu fetching, it is now logged to the console, and `getMenu` returns an empty array `[]`. This allows pages using the Navbar (including `/_not-found`) to build successfully even if the primary header menu is not found, instead of failing the entire build process.