`@clerk/upgrade --release=core-3` exits with an npm ERESOLVE error on Next.js 14 instead of saying Next 15 is required
维护者通常 1 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, nextjs, node.js, typescript
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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:sdkVersionsonly 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 callsprocess.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.
- 主要语言
- TypeScript
- 星标
- 1.8k
- 派生
- 493
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 359
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
clerk/javascript 的其他 Issue
-
<SignIn />: the reset password code step renders an empty, focusable back button with no accessible name可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
clerk/javascript#10708 ·
维护者通常 1 天内回复
-
Built-in reverification dialog lacks an accessible name (aria-dialog-name)可能已有人在做 @ItsShivam05 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
clerk/javascript#10548 ·
维护者通常 1 天内回复
-
MFA enrollment QR SVG lacks an accessible name (svg-img-alt)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
clerk/javascript#10547 ·
维护者通常 1 天内回复
-
<SignIn />: first "Use email" click switches back to phone when `initialValues.phoneNumber` is set可能已有人在做 @twicestruck 于 29 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
clerk/javascript#10487 ·
维护者通常 1 天内回复
-
useLoadedIsomorphicClerk misses "ready" when a ClerkProvider remounts after clerk-js has loaded — <ClerkLoading> never resolves可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
clerk/javascript#10462 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 86/100
superlinked/sie#1033 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
remix-run/react-router#15838 ·
维护者通常 1 天内回复
-
area/ci bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
melgarafael/DeskcommCRM#5290 ·
维护者通常 1 天内回复