Title: @sentry/tanstackstart-react: vite-plugin should not be a runtime dependency · Issue #19360 · getsentry/sentry-javascript · GitHub
Open Graph Title: @sentry/tanstackstart-react: vite-plugin should not be a runtime dependency · Issue #19360 · getsentry/sentry-javascript
X Title: @sentry/tanstackstart-react: vite-plugin should not be a runtime dependency · Issue #19360 · getsentry/sentry-javascript
Description: Problem @sentry/tanstackstart-react@10.39.0 includes @sentry/vite-plugin as a runtime dependency, causing ERR_MODULE_NOT_FOUND errors in production when using pnpm for deployment. Expected Behavior Build-time tools like Vite plugins shou...
Open Graph Description: Problem @sentry/tanstackstart-react@10.39.0 includes @sentry/vite-plugin as a runtime dependency, causing ERR_MODULE_NOT_FOUND errors in production when using pnpm for deployment. Expected Behavior...
X Description: Problem @sentry/tanstackstart-react@10.39.0 includes @sentry/vite-plugin as a runtime dependency, causing ERR_MODULE_NOT_FOUND errors in production when using pnpm for deployment. Expected Behavior...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/19360
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/tanstackstart-react: vite-plugin should not be a runtime dependency","articleBody":"## Problem\n\n`@sentry/tanstackstart-react@10.39.0` includes `@sentry/vite-plugin` as a runtime dependency, causing `ERR_MODULE_NOT_FOUND` errors in production when using pnpm for deployment.\n\n## Expected Behavior\n\nBuild-time tools like Vite plugins should be:\n- Listed as `peerDependencies` in the framework SDK (optional)\n- Installed as `devDependencies` by the user\n- **Never** included as runtime `dependencies`\n\nThis is the pattern used by other framework integrations and documented in Sentry's own bundler plugin documentation.\n\n## Actual Behavior\n\n```json\n// @sentry/tanstackstart-react@10.39.0/package.json\n{\n \"dependencies\": {\n \"@sentry/vite-plugin\": \"^4.8.0\" // ← WRONG\n }\n}\n```\n\nThis pulls `@sentry/bundler-plugin-core` and `@babel/core` (+ ~50 Babel plugins) into production bundles.\n\n## Runtime Errors in Production\n\nWhen deployed with pnpm, these packages aren't hoisted by default, causing:\n\n```\nError [ERR_MODULE_NOT_FOUND]: Cannot find package '@babel/core' \nimported from /app/.output/server/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs\n```\n\nSimilar errors occur for:\n- `@opentelemetry/instrumentation`\n- Various `@sentry/*` and `@babel/*` packages\n\n## Reproduction\n\n1. Create TanStack Start app with `@sentry/tanstackstart-react@10.39.0`\n2. Deploy using `pnpm deploy --prod` (or any pnpm-based deployment)\n3. Run the deployed app\n4. Observe runtime import errors\n\n## Environment\n\n- **Package**: `@sentry/tanstackstart-react@10.39.0`\n- **Runtime**: Node.js production deployment (Docker, serverless, etc.)\n- **Package Manager**: pnpm v10 (with default hoisting behavior)\n- **Framework**: TanStack Start v1.160.0\n\n## Workaround\n\nAdd to `.npmrc`:\n```ini\npublic-hoist-pattern[]=*@opentelemetry/*\npublic-hoist-pattern[]=*@sentry/*\npublic-hoist-pattern[]=*@babel/*\n```\n\nThis forces pnpm to hoist these packages, but has significant drawbacks:\n- **Security**: Bundles ~5-10MB of build tools in production\n- **Performance**: Extra memory overhead and slower cold starts\n- **Bundle size**: Babel + plugins unnecessarily inflates deployments\n\n## Requested Fix\n\nRemove `@sentry/vite-plugin` from `dependencies` in `@sentry/tanstackstart-react/package.json`:\n\n```diff\n{\n- \"dependencies\": {\n- \"@sentry/vite-plugin\": \"^4.8.0\"\n- },\n+ \"peerDependencies\": {\n+ \"@sentry/vite-plugin\": \"^4.8.0\"\n+ },\n+ \"peerDependenciesMeta\": {\n+ \"@sentry/vite-plugin\": {\n+ \"optional\": true\n+ }\n+ }\n}\n```\n\nAnd update documentation to have users install `@sentry/vite-plugin` as a devDependency.\n\n## Similar Issues\n\nThis is the **exact same problem** that exists with other framework SDKs:\n- #9544 - `@sentry/sveltekit` with Netlify deployments\n- Both cases: bundler plugins incorrectly bundled as runtime dependencies\n\n## Additional Context\n\n- Latest version checked: `@sentry/tanstackstart-react@10.39.0` (2026-02-16)\n- Issue persists across all 10.x versions\n- Affects any deployment using pnpm or strict dependency managers\n- Workaround reference: sortie-code/sortie@9ca8966\n\nBuild tools should never be runtime dependencies. This packaging bug:\n1. Violates npm/pnpm best practices\n2. Creates security surface area (unnecessary code in production)\n3. Degrades performance (bundle bloat, memory overhead)\n4. Breaks deployments with proper dependency isolation\n\nPlease consider fixing this packaging issue to align with other Sentry framework SDKs and standard npm practices.","author":{"url":"https://github.com/tttc6","@type":"Person","name":"tttc6"},"datePublished":"2026-02-17T13:51:26Z","url":"https://github.com/getsentry/sentry-javascript/issues/19360"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1a13bd60-b682-8db9-9c1e-a3ab5439b87a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E92A:2815D1:739F59:9E44B8:6B0479FA |
| html-safe-nonce | 506d28c8785c1289cdb396d70e8a97cf8997e763dec7e0427e890eab2c73d1b7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTJBOjI4MTVEMTo3MzlGNTk6OUU0NEI4OjZCMDQ3OUZBIiwidmlzaXRvcl9pZCI6IjQ1MTIwOTc0MDY2NDQ2ODEyMTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4d4cf298190b3af37f61a08ca99aea06f28b04bc37b3f31aaa6226781ea547c1 |
| hovercard-subject-tag | issue:3952874015 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/19360/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c238572fd3ee3acdc89bbce68b649164f42fbc56b97cbb40f0526609ca104b81/getsentry/sentry-javascript/issues/19360 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c238572fd3ee3acdc89bbce68b649164f42fbc56b97cbb40f0526609ca104b81/getsentry/sentry-javascript/issues/19360 |
| og:image:alt | Problem @sentry/tanstackstart-react@10.39.0 includes @sentry/vite-plugin as a runtime dependency, causing ERR_MODULE_NOT_FOUND errors in production when using pnpm for deployment. Expected Behavior... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tttc6 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width