Skip to content

@sentry/nuxt 11: optional nitro peer makes npm install fail with ERESOLVE on Vite 8 #25761

Closed

Description

@ps-20x

How do you use Sentry? Sentry Saas (sentry.io)
Which SDK are you using? @sentry/nuxt
SDK Version: 11.9.0
Framework Version: Nuxt 4.6.3 (nitropack 2.13.5), Vite 8.3.5, Node 24.22.1, npm 11.19.1
Link to Sentry event: n/a (install-time issue)

Reproduction Example/SDK Setup

Nuxt 4.6 app with @sentry/nuxt@^10 installed. Nuxt 4.6.3 itself depends on nitropack@^2.13.5 (via @nuxt/nitro-server) and vite@^8.3.5 (via @nuxt/vite-builder, also a peer of @nuxt/vite-server), so Vite 8 is required and the nitro package isn't installed at all.

Steps to Reproduce

  1. npm install -S @sentry/nuxt@^11

Expected Result

The install succeeds. nitro is an optional peer of @sentry/nuxt (peerDependenciesMeta.nitro.optional: true) and isn't installed in the project, so its peer requirements shouldn't matter.

Actual Result

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: frontend@undefined
npm error Found: @sentry/nuxt@10.63.0
npm error node_modules/@sentry/nuxt
npm error   dev @sentry/nuxt@"^11" from the root project
npm error
npm error Could not resolve dependency:
npm error dev @sentry/nuxt@"^11" from the root project
npm error
npm error Conflicting peer dependency: vite@7.3.7
npm error node_modules/vite
npm error   peerOptional vite@"^7" from nitro@3.0.0
npm error   node_modules/nitro
npm error     peerOptional nitro@"2.x || 3.x" from @sentry/nuxt@11.9.0
npm error     node_modules/@sentry/nuxt
npm error       dev @sentry/nuxt@"^11" from the root project

npm resolves the optional nitro@"2.x || 3.x" peer to nitro@3.0.0, whose optional vite@"^7" peer conflicts with the project's Vite 8. Since Nuxt 4.6 requires Vite 8, this should affect every npm user upgrading a Nuxt 4.6 app to @sentry/nuxt 11.

Additional Context

  • Workarounds:
    • --force works, and the resulting lockfile installs fine with a plain npm ci. Every later npm install still hits the same error, though.
    • --legacy-peer-deps isn't a usable workaround, because it also drops other auto-installed peers (e.g. typescript) from the lockfile.
  • Possibly related: Support nuxt/server in Nuxt 4.6 #25072 (support for nuxt/server in Nuxt 4.6).
  • Possible fix: widen or narrow the nitro peer range so npm doesn't pick a nitro release that requires Vite 7 (e.g. once a Nitro 3 release supports Vite 8), or drop the nitro peer if nitropack users don't need it.

Activity

  1. linear-code commented on Oct 27, 2026

    @linear-code
  2. self-assigned this
    on Oct 28, 2026
  3. added a commit that references this issue on Oct 28, 2026
    c5c2a3a
  4. msonnb commented on Oct 28, 2026

    @msonnb
    Member

    Hey, thanks for reporting! The fix will be included in our next release.

  5. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #25815, which was included in the 11.10.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions