Open cmngan opened 1 year ago
I m using 13.4.1 and also still getting this issue.
Hi, is there any update on this issue? I am also using Internationalization with generateStaticParams in order to statically generate some of the routes for the supported languages. I also get the same error for a page I am trying to paginate. Does it mean that right now if generateStaticParams is used in a layout, its children layouts cannot be dynamically rendered?
We're having the same issue on 13.4.3 : it works as intended with run start
but fails on run dev
. It is very confusing and cleary seems like a bug.
I'm also experiencing this issue; this behavior is very bizarre, and the error message isn't helpful.
So many errors
Same for me with next 13.4.5
, force-static
is not working as expected.
same for me with 13.4.9-canary.2
Also seeing this in a layout. it's fairly annoying for any authenticated routes in the /app folder in dev...
Seems to work fine in build / production with export const dynamic = "force-dynamic"
same for me with 13.4.9
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Internationalization (i18n), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue
https://github.com/cmngan/nextjs-router-test
To Reproduce
This is a minimum reproducible example for testing nextJs router behavior.
Scenario 1: with force-dynamic and generateStaticParams
npm install
npm run dev
http://localhost:3000/en-hk
in your browsernpm install
npm run build
npm run start
http://localhost:3000/en-hk
in your browserScenario 2: without force-dynamic and with generateStaticParams
force-dynamic
in/src/pages/[lang]/page.tsx
force-dynamic
in/src/pages/[lang]/page.tsx
Scenario 3: without force-dynamic and without generateStaticParams
It works
Describe the Bug
When using app router with force-dynamic and generateStaticParams, build and dev behaviours are different.
Although Scenario 3 is working, it means that we cannot static generated all pages except some pages. i.e. Scenario 1. To achieve it, we need to add
generateStaticParams
in all individual page.Not sure if I miss something. It sounds related to https://github.com/vercel/next.js/issues/44712
Expected Behaviour
force-dynamic
even withgenerateStaticParams
, or any other recommended ways to handle the situationWhich browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1191