saleor / storefront

Saleor Storefront built with React 18, Next.js 14, App Router, TypeScript, GraphQL, and Tailwind CSS.
https://storefront.saleor.io
BSD 3-Clause "New" or "Revised" License
1.01k stars 585 forks source link

Cookie cause bug #1052

Closed AndrewZuo01 closed 9 months ago

AndrewZuo01 commented 9 months ago

Summary

I got Page changed from static to dynamic at runtime /default-channel/products/a-default-product, reason: cookies

Steps to reproduce

I self deployed saleor store front and saleor platform, then I added a default product, then I clicked on the product for product detail page

⨯ Page changed from static to dynamic at runtime /default-channel/products/a-default-product, reason: cookies
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error
    at l (/Users/andrew/Desktop/storefront/.next/server/chunks/596.js:1:3724)
    at Object.c (/Users/andrew/Desktop/storefront/.next/server/chunks/596.js:1:1447)
    at Object.getItem (/Users/andrew/Desktop/storefront/.next/server/chunks/272.js:183:4135)
    at s.getRefreshToken (/Users/andrew/Desktop/storefront/.next/server/chunks/272.js:116:5798)
    at S.fetchWithAuth (/Users/andrew/Desktop/storefront/.next/server/chunks/272.js:183:2196)
    at r (/Users/andrew/Desktop/storefront/.next/server/chunks/384.js:657:1174)
    at Module.R (/Users/andrew/Desktop/storefront/.next/server/app/[channel]/(main)/products/[slug]/page.js:6:699)
    at /Users/andrew/Desktop/storefront/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:223590
    at /Users/andrew/Desktop/storefront/node_modules/next/dist/server/lib/trace/tracer.js:131:36
    at NoopContextManager.with (/Users/andrew/Desktop/storefront/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)

after commenting out

截屏2023-12-17 21 35 59

in src/app/[channel]/(main)/products/[slug]/page.tsx I can access to the detail page now, but I cannot add to cart now.

A link to a reproduction repository

No response

Output from envinfo

System:

AndrewZuo01 commented 9 months ago

This error gone roughly after I restarted laptop