Skip to content

@sentry/bundler-plugins imports types from rollup, which causes a TS error because it's an optional dependency #22296

Closed

Description

@aguo-ntech

@sentry/bundler-plugins declares rollup as an optional peer dependency, but its built type definitions for the ./rollup export import TransformResult directly from rollup.

Because the ./vite export transitively imports from the rollup module, consumers of @sentry/vite-plugin (or @sentry/bundler-plugins/vite) who do not have rollup installed hit a TS2307 error.

Reproduction

import { sentryVitePlugin } from '@sentry/vite-plugin';

TypeScript reports:

node_modules/@sentry/bundler-plugins/build/types/rollup/index.d.ts:5:38 - error TS2307: Cannot find module 'rollup' or its corresponding type declarations.

5 import type { TransformResult } from 'rollup';

Findings

  • packages/bundler-plugins/package.json has rollup in peerDependencies with optional: true.
  • packages/bundler-plugins/src/rollup/index.ts line 23: import type { TransformResult } from 'rollup';.
  • packages/bundler-plugins/src/vite/index.ts imports from ../rollup, so the Vite type path depends on the Rollup type file.

Activity

  1. linear-code commented on Jul 15, 2026

    @linear-code
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 15, 2026
  3. sentry-pierre commented on Jul 15, 2026

    @sentry-pierre

    I cleaned up the issue body to remove the template noise and highlight the actual bug.

    What I checked:

    • packages/bundler-plugins/package.json marks rollup as an optional peer dependency.
    • packages/bundler-plugins/src/rollup/index.ts directly imports TransformResult from rollup.
    • packages/bundler-plugins/src/vite/index.ts imports from the rollup module, which is why the Vite path also pulls in the missing type dependency.

    This is a confirmed bundler-plugin type dependency mismatch. A maintainer can take it from here.

  4. self-assigned this
    on Jul 15, 2026
  5. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 15, 2026
  6. isaacs commented on Jul 15, 2026

    @isaacs
    Member

    Thanks for reporting! This is a straightforward bug. Should be addressed by #22304.

  7. added a commit that references this issue on Jul 16, 2026
    6370c7d
  8. github-actions commented on Jul 20, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #22304, which was included in the 10.67.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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions