Skip to content

fix(nuxt): Move @nuxt/kit to peer/dev deps to avoid duplicate on Nuxt 4 - #22713

Open
thijsw wants to merge 1 commit into
getsentry:developfrom
thijsw:thijsw/nuxt-kit-4
Open

fix(nuxt): Move @nuxt/kit to peer/dev deps to avoid duplicate on Nuxt 4#22713
thijsw wants to merge 1 commit into
getsentry:developfrom
thijsw:thijsw/nuxt-kit-4

Conversation

@thijsw

@thijsw thijsw commented Jul 27, 2026

Copy link
Copy Markdown

Summary

@sentry/nuxt declares @nuxt/kit: ^3.13.2 as a regular dependency. On a Nuxt 4 app (@nuxt/kit@4.x), the ^3 cap (>=3.13.2 <4.0.0) can't dedupe with the app's 4.x, so a second copy of @nuxt/kit (3.x) gets installed next to the app's 4.x:

@nuxt/kit@4.5.1   ← nuxt 4.5.1
@nuxt/kit@3.21.9  ← @sentry/nuxt

Following @s1gr1d's suggestion in the issue, this moves @nuxt/kit:

  • out of dependencies
  • into devDependencies (^3.13.2) — so the SDK still builds/tests against 3.x
  • into peerDependencies (^3.13.2 || ^4.0.0) — so the host Nuxt app supplies the single, deduplicated version

@nuxt/kit 4.x is backward compatible with the 3.x APIs the module uses, and nuxt is already a required peer (which itself provides @nuxt/kit), so a required @nuxt/kit peer is safe.

No lockfile change: the ^3.13.2 range is unchanged (now via the devDependency), and yarn classic does not lock peerDependencies.

Closes #22679

@thijsw
thijsw requested review from a team as code owners July 27, 2026 13:52
@thijsw
thijsw requested review from JPeer264, isaacs, logaretm, msonnb, nicohrubec and s1gr1d and removed request for a team July 27, 2026 13:52
@thijsw

thijsw commented Jul 27, 2026

Copy link
Copy Markdown
Author

@s1gr1d as suggested in #22679 — this moves @nuxt/kit to a peer + dev dependency. I couldn't add you as a reviewer directly (external contributor), so tagging you here. 🙏

@sentry

sentry Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

🚧 Skipped: PR exceeds review size limit.

Please split into smaller PRs and re-run.
Reference ID: 15504178

@thijsw
thijsw force-pushed the thijsw/nuxt-kit-4 branch from 42180eb to 25c909d Compare July 27, 2026 13:55
@s1gr1d

s1gr1d commented Jul 27, 2026

Copy link
Copy Markdown
Member

@thijsw Please base the branch on develop not master

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 25c909d. Configure here.

"access": "public"
},
"peerDependencies": {
"@nuxt/kit": "^3.13.2 || ^4.0.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kit peer range mismatch

Medium Severity

Moving @nuxt/kit to a required peer keeps the old ^3.13.2 floor, but the nuxt peer still allows >=3.7.0 and 5.x. Nuxt ships kit in lockstep, so supported 3.7–3.12 apps and future Nuxt 5 apps will not satisfy this peer and can hit unmet-peer install failures or warnings. As a dependency that floor only constrained what the SDK installed; as a peer it now constrains host compatibility.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 25c909d. Configure here.

"local-pkg": "^1.1.2"
},
"devDependencies": {
"@nuxt/kit": "^3.13.2",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing fix regression test

Low Severity

This is a fix PR but it adds no unit, integration, or E2E coverage that would fail without the change and pass with it—for example asserting a single deduped @nuxt/kit on Nuxt 4. Flagged per the Testing Conventions rule for fix PRs.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 25c909d. Configure here.

…xt 4

`@sentry/nuxt` declared `@nuxt/kit: ^3.13.2` as a regular dependency. On a
Nuxt 4 app (`@nuxt/kit@4.x`), the `^3` cap (`>=3.13.2 <4.0.0`) can't dedupe
with the app's 4.x, forcing a second copy of `@nuxt/kit` into the tree.

Move `@nuxt/kit` to `devDependencies` (for building/testing against 3.x) and
add it as a `peerDependency` with a widened range so the host Nuxt app supplies
the single, deduplicated version.
@thijsw
thijsw force-pushed the thijsw/nuxt-kit-4 branch from 25c909d to 335d524 Compare July 27, 2026 13:58
@thijsw
thijsw changed the base branch from master to develop July 27, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@sentry/nuxt: widen @nuxt/kit dependency to ^3 || ^4 to avoid a duplicate @nuxt/kit on Nuxt 4

2 participants