google-labs-jules[bot] fc661b75ec Fix: Gracefully handle cart fetching for _not-found page
The prerendering of the `/_not-found` page was failing due to an error in the Server Components render, specifically when the `RootLayout` attempted to fetch cart data using `getCart()`. The `getCart()` function uses `cookies()`, which is not available or reliable during the static prerendering of error pages.

This commit modifies `app/layout.tsx` to wrap the `getCart()` call in a `try...catch` block. If an error occurs during this call (e.g., during build-time rendering of `_not-found.tsx`), it now logs the error and defaults to a `Promise.resolve(undefined)` for the cart state.

The `CartProvider` and related components are already designed to handle an undefined cart, ensuring that your application remains stable and the build process can complete successfully for static pages like `_not-found`.
2025-05-21 06:19:11 +00:00
..
2025-05-20 17:29:24 +02:00
2025-02-09 11:38:22 -06:00
2025-02-09 11:38:22 -06:00
2025-02-09 11:38:22 -06:00
2024-03-26 16:15:01 -05:00
2023-08-02 21:17:11 -05:00
2025-02-09 11:38:22 -06:00
2025-05-20 17:24:09 +02:00
2025-02-09 11:38:22 -06:00
2025-02-09 11:38:22 -06:00
2025-02-09 11:38:22 -06:00
2025-02-09 11:38:22 -06:00