Skip to content

Commit 2a3682f

Browse files
authored
fix(deps): ensure Next.js 15.2.0 compatibility, upgrade nextjs and @types/react versions in monorepo (#11419)
This bumps next.js to 15.2.0 in our monorepo, as well as all @types/react and @types/react-dom versions. Additionally, it removes the obsolete `peerDependencies` property from our root package.json. This PR also fixes 2 bugs introduced by Next.js 15.2.0. This highlights why running our test suite against the latest Next.js, to make sure Payload is compatible, version is important. ## 1. handleWhereChange running endlessly Upgrading to Next.js 15.2.0 caused `handleWhereChange` to be continuously called by a `useEffect` when the list view filters were opened, leading to a React error - I did not investigate why upgrading the Next.js version caused that, but this PR fixes it by making use of the more predictable `useEffectEvent`. ## 2. Custom Block and Array label React key errors Upgrading to Next.js 15.2.0 caused react key errors when rendering custom block and array row labels on the server. This has been fixed by rendering those with a key ## 3. Table React key errors When rendering a `Table`, a React key error is thrown since Next.js 15.2.0
1 parent 958e195 commit 2a3682f

File tree

18 files changed

+194
-186
lines changed

18 files changed

+194
-186
lines changed

package.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"devDependencies": {
118118
"@jest/globals": "29.7.0",
119119
"@libsql/client": "0.14.0",
120-
"@next/bundle-analyzer": "15.1.5",
120+
"@next/bundle-analyzer": "15.2.0",
121121
"@payloadcms/db-postgres": "workspace:*",
122122
"@payloadcms/eslint-config": "workspace:*",
123123
"@payloadcms/eslint-plugin": "workspace:*",
@@ -132,8 +132,8 @@
132132
"@types/jest": "29.5.12",
133133
"@types/minimist": "1.2.5",
134134
"@types/node": "22.5.4",
135-
"@types/react": "19.0.1",
136-
"@types/react-dom": "19.0.1",
135+
"@types/react": "19.0.10",
136+
"@types/react-dom": "19.0.4",
137137
"@types/shelljs": "0.8.15",
138138
"chalk": "^4.1.2",
139139
"comment-json": "^4.2.3",
@@ -153,7 +153,7 @@
153153
"lint-staged": "15.2.7",
154154
"minimist": "1.2.8",
155155
"mongodb-memory-server": "^10",
156-
"next": "15.1.5",
156+
"next": "15.2.0",
157157
"open": "^10.1.0",
158158
"p-limit": "^5.0.0",
159159
"playwright": "1.50.0",
@@ -173,10 +173,6 @@
173173
"turbo": "^2.3.3",
174174
"typescript": "5.7.3"
175175
},
176-
"peerDependencies": {
177-
"react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
178-
"react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020"
179-
},
180176
"packageManager": "pnpm@9.7.1",
181177
"engines": {
182178
"node": "^18.20.2 || >=20.9.0",

packages/live-preview-react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
},
4646
"devDependencies": {
4747
"@payloadcms/eslint-config": "workspace:*",
48-
"@types/react": "19.0.1",
49-
"@types/react-dom": "19.0.1",
48+
"@types/react": "19.0.10",
49+
"@types/react-dom": "19.0.4",
5050
"payload": "workspace:*"
5151
},
5252
"peerDependencies": {

packages/next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
"@next/eslint-plugin-next": "15.1.5",
108108
"@payloadcms/eslint-config": "workspace:*",
109109
"@types/busboy": "1.5.4",
110-
"@types/react": "19.0.1",
111-
"@types/react-dom": "19.0.1",
110+
"@types/react": "19.0.10",
111+
"@types/react-dom": "19.0.4",
112112
"@types/uuid": "10.0.0",
113113
"babel-plugin-react-compiler": "19.0.0-beta-714736e-20250131",
114114
"esbuild": "0.24.2",

packages/plugin-cloud-storage/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
},
6565
"devDependencies": {
6666
"@types/find-node-modules": "^2.1.2",
67-
"@types/react": "19.0.1",
68-
"@types/react-dom": "19.0.1",
67+
"@types/react": "19.0.10",
68+
"@types/react-dom": "19.0.4",
6969
"payload": "workspace:*"
7070
},
7171
"peerDependencies": {

packages/plugin-form-builder/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
"devDependencies": {
6868
"@payloadcms/eslint-config": "workspace:*",
6969
"@types/escape-html": "^1.0.4",
70-
"@types/react": "19.0.1",
71-
"@types/react-dom": "19.0.1",
70+
"@types/react": "19.0.10",
71+
"@types/react-dom": "19.0.4",
7272
"copyfiles": "^2.4.1",
7373
"cross-env": "^7.0.3",
7474
"payload": "workspace:*"

packages/plugin-search/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
},
6565
"devDependencies": {
6666
"@payloadcms/eslint-config": "workspace:*",
67-
"@types/react": "19.0.1",
68-
"@types/react-dom": "19.0.1",
67+
"@types/react": "19.0.10",
68+
"@types/react-dom": "19.0.4",
6969
"payload": "workspace:*"
7070
},
7171
"peerDependencies": {

packages/plugin-sentry/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
},
5959
"devDependencies": {
6060
"@payloadcms/eslint-config": "workspace:*",
61-
"@types/react": "19.0.1",
62-
"@types/react-dom": "19.0.1",
61+
"@types/react": "19.0.10",
62+
"@types/react-dom": "19.0.4",
6363
"payload": "workspace:*"
6464
},
6565
"peerDependencies": {

packages/plugin-seo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
"devDependencies": {
7171
"@payloadcms/eslint-config": "workspace:*",
7272
"@payloadcms/next": "workspace:*",
73-
"@types/react": "19.0.1",
74-
"@types/react-dom": "19.0.1",
73+
"@types/react": "19.0.10",
74+
"@types/react-dom": "19.0.4",
7575
"payload": "workspace:*"
7676
},
7777
"peerDependencies": {

packages/plugin-stripe/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
"@payloadcms/eslint-config": "workspace:*",
7272
"@payloadcms/next": "workspace:*",
7373
"@types/lodash.get": "^4.4.7",
74-
"@types/react": "19.0.1",
75-
"@types/react-dom": "19.0.1",
74+
"@types/react": "19.0.10",
75+
"@types/react-dom": "19.0.4",
7676
"@types/uuid": "10.0.0",
7777
"payload": "workspace:*"
7878
},

packages/richtext-lexical/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@
383383
"@types/escape-html": "1.0.4",
384384
"@types/json-schema": "7.0.15",
385385
"@types/node": "22.5.4",
386-
"@types/react": "19.0.1",
387-
"@types/react-dom": "19.0.1",
386+
"@types/react": "19.0.10",
387+
"@types/react-dom": "19.0.4",
388388
"babel-plugin-react-compiler": "19.0.0-beta-714736e-20250131",
389389
"babel-plugin-transform-remove-imports": "^1.8.0",
390390
"esbuild": "0.24.2",

0 commit comments

Comments
 (0)