Skip to content

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

Description

@thijsw

Problem

@sentry/nuxt@10.68.0 declares @nuxt/kit: ^3.13.2 as a dependency. On a Nuxt 4
project (@nuxt/kit@4.x), the ^3 cap forces a second copy of @nuxt/kit
(3.x) into the tree next to the app's 4.x — since ^3.13.2 means
>=3.13.2 <4.0.0 and can't dedupe with 4.x.

Reproduction

Install @sentry/nuxt in a Nuxt 4.5 app and inspect the tree:

@nuxt/kit@4.5.1   ← nuxt 4.5.1
@nuxt/kit@3.21.9  ← @sentry/nuxt
pnpm why @nuxt/kit
# => @nuxt/kit 3.21.9 is pulled by @sentry/nuxt

Expected

A single @nuxt/kit version shared across the app and the SDK. @nuxt/kit 4.x is
backward compatible with the 3.x APIs the Sentry module uses, so it should be
safe to accept both majors.

Suggested change

In packages/nuxt/package.json, widen the range:

- "@nuxt/kit": "^3.13.2"
+ "@nuxt/kit": "^3.13.2 || ^4.0.0"

(If the SDK is expected to run only inside a Nuxt app, @nuxt/kit could
alternatively be moved to peerDependencies, letting the host app supply the
single version — but widening the range is the minimal, low-risk fix.)

Environment

  • @sentry/nuxt: 10.68.0 (latest)
  • nuxt: 4.5.1
  • @nuxt/kit (app): 4.5.1
  • Package manager: pnpm 11

I can send a PR if you'd like.

Metadata

Metadata

Assignees

Projects

Status
Waiting for: Community

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions