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`.
🔧💡 Fix: Enhance product gallery layout in product view page
- 🖼️ Implemented `flex-wrap` for the sub-gallery images.
- 🛠️ Ensured images wrap automatically when they exceed 5 or 6, preventing overflow and maintaining responsive design.
- ✅ Confirmed that the layout remains unaffected for galleries with 3 or fewer images.
This improvement enhances user experience by making sure large image sets are displayed without affecting screen layout.
* feat(design): Show carousel above the fold on desktop
Before this commit, we would not see the carousel without scrolling. The top
images are so big that take most of the space. This made the website looked a
bit weird, thus I am proposing this change.
* uneeded