From 404890a84eea9b828ed371d222d12f9a3bf6b893 Mon Sep 17 00:00:00 2001 From: Rob Decker <852280+robdecker@users.noreply.github.com> Date: Mon, 21 Sep 2026 14:42:43 -0700 Subject: [PATCH] feat(next-drupal): add Next.js 16 support via peerDependencies Next 16 fell outside the declared `next` range, so package managers installed a second copy of Next inside next-drupal. That gave consumers two NextURL types. NextURL carries a `private [Internal]` member typed as a `unique symbol`, and two installs declare two distinct symbols, so the types are nominally incompatible even when the declaration files are byte identical. Passing a NextRequest to enableDraftMode failed with "Types of property 'nextUrl' are incompatible". Move next, react and react-dom to peerDependencies and add ^16.0.0 to the next range. The peer range is a superset of the old dependency range, so every currently valid install stays valid. Consumers who did not already depend on next now have to declare it, which is the normal arrangement for a Next library. react-dom is imported nowhere in the package and react only by the deprecated useMenu hook, but both stay declared as peers to match what Next itself requires. Closes #884 --- packages/next-drupal/package.json | 9 +++++++-- yarn.lock | 26 +++++++++++++------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/packages/next-drupal/package.json b/packages/next-drupal/package.json index 150bac93..6e65e8c2 100644 --- a/packages/next-drupal/package.json +++ b/packages/next-drupal/package.json @@ -73,13 +73,18 @@ }, "dependencies": { "jsona": "^1.12.1", - "next": "^14.2.21 || ^15.1.2", "node-cache": "^5.1.2", - "qs": "^6.13.1", + "qs": "^6.13.1" + }, + "peerDependencies": { + "next": "^14.2.21 || ^15.1.2 || ^16.0.0", "react": "^18.2 || ^19.0", "react-dom": "^18.2 || ^19.0" }, "devDependencies": { + "next": "^15.1.2", + "react": "^19.0.0", + "react-dom": "^19.0.0", "typescript": "^5.7.2" } } diff --git a/yarn.lock b/yarn.lock index 138c54a2..fb00229b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9737,7 +9737,7 @@ next@^14.2.21: "@next/swc-win32-ia32-msvc" "14.2.23" "@next/swc-win32-x64-msvc" "14.2.23" -"next@^14.2.21 || ^15.1.2", next@^15.1.2: +next@^15.1.2: version "15.1.6" resolved "https://registry.yarnpkg.com/next/-/next-15.1.6.tgz#ce22fd0a8f36da1fc4aba86e3ec7e98eb248c555" integrity sha512-Hch4wzbaX0vKQtalpXvUiw5sYivBy4cm5rzUKrBnUB/y436LGrvOUqYvlSeNVCWFO/770gDlltR9gqZH62ct4Q== @@ -10991,13 +10991,6 @@ rc@1.2.8, rc@^1.0.1, rc@^1.1.6, rc@^1.2.1, rc@^1.2.7, rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" -"react-dom@^18.2 || ^19.0", react-dom@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.0.0.tgz#43446f1f01c65a4cd7f7588083e686a6726cfb57" - integrity sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ== - dependencies: - scheduler "^0.25.0" - react-dom@^18.2.0: version "18.3.1" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4" @@ -11006,6 +10999,13 @@ react-dom@^18.2.0: loose-envify "^1.1.0" scheduler "^0.23.2" +react-dom@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.0.0.tgz#43446f1f01c65a4cd7f7588083e686a6726cfb57" + integrity sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ== + dependencies: + scheduler "^0.25.0" + react-highlight-words@^0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/react-highlight-words/-/react-highlight-words-0.18.0.tgz#ff3b3ef7cb497fa2e8fa4d54c1a1a98ac6390d0e" @@ -11048,11 +11048,6 @@ react-property@2.0.2: resolved "https://registry.yarnpkg.com/react-property/-/react-property-2.0.2.tgz#d5ac9e244cef564880a610bc8d868bd6f60fdda6" integrity sha512-+PbtI3VuDV0l6CleQMsx2gtK0JZbZKbpdu5ynr+lbsuvtmgbNcS3VM0tuY2QjFNOcWxvXeHjDpy42RO+4U2rug== -"react@^18.2 || ^19.0", react@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/react/-/react-19.0.0.tgz#6e1969251b9f108870aa4bff37a0ce9ddfaaabdd" - integrity sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ== - react@^18.2.0: version "18.3.1" resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891" @@ -11060,6 +11055,11 @@ react@^18.2.0: dependencies: loose-envify "^1.1.0" +react@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/react/-/react-19.0.0.tgz#6e1969251b9f108870aa4bff37a0ce9ddfaaabdd" + integrity sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ== + read-cache@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774"