Repository navigation
feat(next-drupal): add Next.js 16 support via peerDependencies - #930
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
thejimbirch
approved these changes
Sep 21, 2026
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
robdecker
force-pushed
the
feat/next-16-peer-deps
branch
from
September 22, 2026 00:00
970d04a to
404890a
Compare
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request is for: (mark with an "x")
examples/*modules/nextpackages/next-drupalstarters/basic-starterstarters/graphql-starterstarters/pages-starterGitHub Issue: #884
Describe your changes
Adds Next.js 16 support without breaking Next 14 or 15.
The problem
nextwas a regular dependency ranged^14.2.21 || ^15.1.2, with nopeerDependenciesat all. Next 16 fell outside that range, so package managers installed a second copy of Next insidenext-drupaland consumers got twoNextURLtypes.NextURLcarries aprivate [Internal]member typed as aunique symbol, so two installs produce two incompatible types even though the declaration files are byte identical. Hence #884:The change
Move
next,reactandreact-domtopeerDependenciesand add^16.0.0to thenextrange. They are also added todevDependenciessotsupandjeststill resolvenext/*in the workspace.Not a breaking change, should release as 2.1.0. The peer range is a strict superset of the old dependency range, so every currently valid install stays valid. Consumers who never declared
nextthemselves now have to, which is normal for a Next library and matchesnext-auth.Verified
Against a Next 16.3.1 app consuming a packed build of this branch: one copy of Next instead of two, and
tsc --noEmitunderstrictclean where published 2.0.1 fails. Typechecking the source against next 16.3.1 and 15.1.2 gives identical error lists, so Next 16 adds no new errors.In the monorepo: install,
tsupbuild and DTS build clean;yarn workspace next-drupal testgives 163 passed across 10 suites. The full suite was not run: the integration files need a live Drupal, so only thepull_requestsubset ran.Known gaps
No Next 16 leg in CI: the workflow pins Node 18.19.x and Next 16 needs Node >= 20.9, so nothing here is proven by CI.
The Pages Router
*FromContexthelpers are typechecked but not runtime tested on 16, as raised in NextJS 16 #884.Was AI used in this pull request?