You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@sentry/bundler-plugins imports types from rollup, which causes a TS error because it's an optional dependency #22296
@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.
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
linear-code commentedon Jul 15, 2026
JS-3054
sentry-pierre commentedon Jul 15, 2026
I cleaned up the issue body to remove the template noise and highlight the actual bug.
What I checked:
packages/bundler-plugins/package.jsonmarksrollupas an optional peer dependency.packages/bundler-plugins/src/rollup/index.tsdirectly importsTransformResultfromrollup.packages/bundler-plugins/src/vite/index.tsimports 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.
isaacs commentedon Jul 15, 2026
Thanks for reporting! This is a straightforward bug. Should be addressed by #22304.
fix(bundler): do not import type from optional peer dep (#22304)
github-actions commentedon Jul 20, 2026
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.