Title: need for runtime dependency is breaking the build · Issue #18215 · getsentry/sentry-javascript · GitHub
Open Graph Title: need for runtime dependency is breaking the build · Issue #18215 · getsentry/sentry-javascript
X Title: need for runtime dependency is breaking the build · Issue #18215 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/18215
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"need for runtime dependency is breaking the build","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/sveltekit\n\n### SDK Version\n\n10.25.0\n\n### Framework Version\n\n10.25.0\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\nThe current docs suggest to import `@sentry/sveltekit` as runtime dep. That's pretty bad as is pulls in deps that are really (or at least should) only be needed during build time. To make this possible I tried to split the imports.\n\nFor node (`hooks.server.ts`) I can use \n\n```\nimport * as Sentry from '@sentry/node';\n\n Sentry.init({\n dsn: config.sentry.dsn,\n tracesSampleRate: 0\n });\n```\n\nbut for the browser (`hooks.client.ts`) I still need\n\n```\nimport * as Sentry from '@sentry/sveltekit';\n\n Sentry.init({\n dsn: env.PUBLIC_SENTRY_DSN,\n tracesSampleRate: 0,\n })\n\n```\n\nand with a `package.json` like this\n\n```\n \"devDependencies\": {\n \"@sentry/sveltekit\": \"^10.25.0\"\n ...\n },\n \n \"dependencies\": {\n \"@sentry/node\": \"^10.25.0\",\n ...\n },\n```\n\nand `vite.config.ts` like this\n```\nexport default defineConfig(({ mode }) => {\n return {\n ssr: {\n external: ['fsevents', '@sentry/sveltekit']\n },\n```\n\nIt should work. But it does not.\n\n### Steps to Reproduce\n\nSee above\n\n### Expected Result\n\nThere is vite plugin that needs to be available as `devDependency`.\nThere is a runtime component that needs to be available as `dependency`.\n\nThe Sentry SDK should clearly separate dev and runtime deps.\nThe vite plugin should not be needed as `dependency`.\n\n### Actual Result\n\nRight now dev tooling is needed during runtime - which makes the build bigger and is clearly wrong.\n\nSeparating the two as documented in this issue currently gives a build error.\n\n```\nerror during build:\nRollupError: node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.node (1:0): Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)\n at getRollupError (file:///sk/node_modules/.pnpm/rollup@4.52.5/node_modules/rollup/dist/es/shared/parseAst.js:401:41)\n at ParseError.initialise (file:///sk/node_modules/.pnpm/rollup@4.52.5/node_modules/rollup/dist/es/shared/node-entry.js:14454:28)\n at convertNode (file:///sk/node_modules/.pnpm/rollup@4.52.5/node_modules/rollup/dist/es/shared/node-entry.js:16337:10)\n at convertProgram (file:///sk/node_modules/.pnpm/rollup@4.52.5/node_modules/rollup/dist/es/shared/node-entry.js:15577:12)\n at Module.setSource (file:///sk/node_modules/.pnpm/rollup@4.52.5/node_modules/rollup/dist/es/shared/node-entry.js:17332:24)\n at async ModuleLoader.addModuleSource (file:///sk/node_modules/.pnpm/rollup@4.52.5/node_modules/rollup/dist/es/shared/node-entry.js:21352:13)\n ELIFECYCLE Command failed with exit code 1.\n```\n\n### Additional Context\n\n\u003csub>Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.\u003c/sub>","author":{"url":"https://github.com/tcurdt","@type":"Person","name":"tcurdt"},"datePublished":"2025-11-16T02:54:51Z","url":"https://github.com/getsentry/sentry-javascript/issues/18215"}
| 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:ae2a1445-60ec-bdd3-ee0d-5e40ff777b9f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE18:1D9E7F:1BFA22:269CA1:6B0448A8 |
| html-safe-nonce | 341c7f404a8864969ea164fb4bc90cc5c0c17b03542daaf38e9d8aed62ef8f8e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTE4OjFEOUU3RjoxQkZBMjI6MjY5Q0ExOjZCMDQ0OEE4IiwidmlzaXRvcl9pZCI6IjQ1NTU0MzAyMjA3NTIyNDI4NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d2058b6ee6dd6f775a7dc63ff442f0bba6110136f3c0230c49e8fef6c25ba9e7 |
| hovercard-subject-tag | issue:3629705312 |
| 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/18215/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8caba1906572128eee63cc2568a26a59c0a21b08580d0637811f148134176c82/getsentry/sentry-javascript/issues/18215 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8caba1906572128eee63cc2568a26a59c0a21b08580d0637811f148134176c82/getsentry/sentry-javascript/issues/18215 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tcurdt |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46 |
| 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 | 9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77 |
| 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