Open coleea opened 1 month ago
If my argument is not wrong, I am willing to implement it, so please reply
This is already fixed: https://github.com/facebook/react/pull/29167
This will roll out once we make a new release of the healthcheck script
@gsathya The PR you mentioned is just check whether reactStrictMode: true
option exists in next.config.mjs
or not. that's not enough.
I wrote this issue after reading this PR.
There are 6 cases
1) App router + reactStrictMode: true
=> strict mode. PR cover this case.
2) App router + reactStrictMode: false
=> non-strict mode. PR cover this case.
3) App router + reactStrictMode option is not set
=> strict mode. PR does not cover this case.
4) Page router + reactStrictMode: true
=> strict mode. PR cover this case.
5) Page router + reactStrictMode: false
=> non-strict mode. PR cover this case.
6) Page router + reactStrictMode option is not set
=> non-strict mode. PR cover this case.
Please check the 3rd case to determine whether #29167 covers this or not.
Ah good point, I'll re-open this.
What kind of issue is this?
Link to repro
https://github.com/coleea/bug-report-next15-server-action
Repro steps
just run command
npx react-compiler-healthcheck@latest
. then, react-compiler-healthcheck does not check StrictMode even though Next.js is actually StrictMode.Next.js is StrictMode by default under these two conditions are met
1) Next.js version 13.4+ 2) App router
You can check this : https://rc.nextjs.org/docs/app/api-reference/next-config-js/reactStrictMode
So, It needs extra three steps to check whether StrictMode or Not. 1) check package.json if Next.js version is over 13.4 or not. 2) If so, Check if
reactStrictMode: false
is not set. 3) check if project is App-Router-based.If three conditions are met, this project is based on StrictMode even though
reactStrictMode: true
is not set onnext.config.mjs
file.How often does this bug happen?
Every time
What version of React are you using?
19.0.0-rc.0