`@clerk/upgrade --release=core-3` exits with an npm ERESOLVE error on Next.js 14 instead of saying Next 15 is required

Aperta
#10,967 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@wobsoriano ci sta già lavorando.

Dal 24/11/2026.

  • #10995 di @wobsoriano — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Ambito
cli, tooling

Direzione di ricerca

Start by reading packages/upgrade/versions/core-3/index.js to see how sdkVersions is declared, then trace performUpgrade() and the main flow in packages/upgrade/cli.js, especially where the package-manager install runs before codemods. Add a pre-install check that reads the installed next version, compares it with the new SDK's peer range, and stops with the suggested message before any install or migration. Verify with a Next 14 fixture that the tool exits early without running npm or codemods, and with Next 15 that the upgrade proceeds.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Issue

@clerk/nextjs@7 declares the peer dependency next@"^15.2.8 || ^15.3.8 || ^15.4.10 || ^15.5.9 || ^15.6.0-0 || ^16.0.10 || ^16.1.0-0".
@clerk/upgrade never checks the installed next version before upgrading. On a Next 14 app,
npx @clerk/upgrade --sdk=nextjs --release=core-3 runs npm install @clerk/nextjs@7, npm rejects it, and the tool exits with:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error Could not resolve dependency:
npm error peer next@"^15.2.8 || ^15.3.8 || ^15.4.10 || ^15.5.9 || ^15.6.0-0 || ^16.0.10 || ^16.1.0-0" from @clerk/[email protected]
✗ Failed to upgrade @clerk/nextjs
Where

packages/upgrade, as published in @clerk/[email protected]:

  • versions/core-3/index.js: sdkVersions only records the Clerk SDK's own versions (nextjs: { from: 6, to: 7 }).
    There is no minimum framework version.
  • cli.js, performUpgrade(): runs the package manager's install directly. When it fails, it prints the
    package manager's output and calls process.exit(1).
  • cli.js, the main flow: the package upgrade (step 6) runs before the codemods (step 7), so a failed
    install means no codemods run.
Consequences
  • The upgrade stops with nothing migrated: no codemods run and no breaking-change scan is done.
  • The only explanation is npm's peer-dependency dump. Nothing says "upgrade Next.js to 15.2.8+ or 16 first",
    so users have to work it out from npm's resolver output.
Suggested fix

Before step 6, read the installed framework version and compare it with the new SDK's peer range, e.g.
a peerRequirements: { nextjs: { next: '>=15.2.8' } } entry in versions/core-3. If it doesn't match, stop
before changing anything:

core-3 needs Next.js 15.2.8+ or 16. You have 14.2.16. Upgrade Next.js first, then rerun.


Found with modeval, which runs codemods against real repositories
that depend on a package and checks the results.

Lingua principale
TypeScript
Stelle
1.8k
Fork
493
Merge medio
1g 8h
PR unite (30g)
359

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di clerk/javascript

Tutte le issue di clerk/javascript

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.