Title: `sentrySvelteKit` loads Vite config in the wrong mode · Issue #15414 · getsentry/sentry-javascript · GitHub
Open Graph Title: `sentrySvelteKit` loads Vite config in the wrong mode · Issue #15414 · getsentry/sentry-javascript
X Title: `sentrySvelteKit` loads Vite config in the wrong mode · Issue #15414 · 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/15414
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`sentrySvelteKit` loads Vite config in the wrong mode","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\n9.1.0\n\n### Framework Version\n\n2.16.0\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\nhttps://github.com/giacomoran/sveltekit-sentry-vite-config\n\n### Steps to Reproduce\n\n1. Create SvelteKit project\n2. Add `@sentry/sveltekit` as dependency\n3. Add the `sentrySvelteKit` plugin to Vite config\n4. Log the mode in which the Vite config is loaded\n5. Run `vite build --mode staging`\n\n### Expected Result\n\nEvery time the Vite config is loaded, the mode is `staging`.\n\n### Actual Result\n\nWhen the `sentrySvelteKit` plugin loads the Vite config, the mode is `production` instead of `staging`.\n\nExample output:\n```\n❯ bun vite build --mode staging\n\n***********\nVite command=build mode=staging\n***********\n\n\n***********\nVite command=build mode=production\n***********\n\n[sentry-vite-plugin] Warning: No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/\n[sentry-vite-plugin] Warning: No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/\n[sentry-vite-plugin] Warning: No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/\n[sentry-vite-plugin] Warning: No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/\nvite v6.1.0 building SSR bundle for staging...\n[sentry-vite-plugin] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set `options.telemetry` to `false`.\n✓ 189 modules transformed.\n\n***********\nVite command=build mode=staging\n***********\n\n[sentry-vite-plugin] Warning: No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/\n[sentry-vite-plugin] Warning: No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/\nvite v6.1.0 building for staging...\n[sentry-vite-plugin] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set `options.telemetry` to `false`.\n✓ 173 modules transformed.\n.svelte-kit/output/client/_app/version.json 0.03 kB │ gzip: 0.05 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-greek-ext-400-normal.BEhC8Nsh.woff 6.60 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-cyrillic-400-normal.Dq7SlH2J.woff 7.09 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-greek-ext-400-normal.CsqI23CO.woff2 7.51 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-greek-400-normal.DUeQbRz0.woff 8.46 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-latin-ext-400-normal.lWlD_NAB.woff 9.09 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-cyrillic-400-normal.36-45Uyg.woff2 9.10 kB\n.svelte-kit/output/client/.vite/manifest.json 9.73 kB │ gzip: 1.24 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-greek-400-normal.C3zng6O6.woff2 10.52 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-latin-ext-400-normal.D6XfiR-_.woff2 11.36 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-cyrillic-ext-400-normal.0xXfcOOq.woff 12.91 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-latin-400-normal.g4W12wf9.woff 13.51 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-cyrillic-ext-400-normal.B04YIrm4.woff2 15.77 kB\n.svelte-kit/output/client/_app/immutable/assets/fira-mono-latin-400-normal.DKjLVgQi.woff2 16.28 kB\n.svelte-kit/output/client/_app/immutable/assets/svelte-welcome.0pIiHnVF.webp 115.47 kB\n.svelte-kit/output/client/_app/immutable/assets/svelte-welcome.VNiyy3gC.png 360.81 kB\n.svelte-kit/output/client/_app/immutable/assets/5.Dv9QCmvw.css 0.74 kB │ gzip: 0.35 kB\n.svelte-kit/output/client/_app/immutable/assets/2.sTI-GHXi.css 1.37 kB │ gzip: 0.54 kB\n.svelte-kit/output/client/_app/immutable/assets/4.yeGN9jlM.css 3.69 kB │ gzip: 1.07 kB\n.svelte-kit/output/client/_app/immutable/assets/0.DSX17XxN.css 5.17 kB │ gzip: 1.79 kB\n.svelte-kit/output/client/_app/immutable/chunks/DBmd8quF.js 0.35 kB │ gzip: 0.24 kB\n.svelte-kit/output/client/_app/immutable/chunks/DgStOBMz.js 0.37 kB │ gzip: 0.26 kB\n.svelte-kit/output/client/_app/immutable/entry/start.D5zZEnrW.js 0.38 kB │ gzip: 0.25 kB\n.svelte-kit/output/client/_app/immutable/chunks/DlfyDkXB.js 0.64 kB │ gzip: 0.41 kB\n.svelte-kit/output/client/_app/immutable/chunks/DVF7FWmE.js 0.69 kB │ gzip: 0.44 kB\n.svelte-kit/output/client/_app/immutable/nodes/1.Ci72-fjt.js 0.79 kB │ gzip: 0.47 kB\n.svelte-kit/output/client/_app/immutable/chunks/D_1uIIW3.js 0.99 kB │ gzip: 0.57 kB\n.svelte-kit/output/client/_app/immutable/chunks/CKMHPBEz.js 1.44 kB │ gzip: 0.78 kB\n.svelte-kit/output/client/_app/immutable/nodes/3.SlmJ48Gf.js 1.46 kB │ gzip: 0.87 kB\n.svelte-kit/output/client/_app/immutable/chunks/BRlSy12D.js 1.50 kB │ gzip: 0.82 kB\n.svelte-kit/output/client/_app/immutable/nodes/5.D8_zdY51.js 2.26 kB │ gzip: 1.03 kB\n.svelte-kit/output/client/_app/immutable/chunks/DJAd4BHt.js 3.50 kB │ gzip: 1.77 kB\n.svelte-kit/output/client/_app/immutable/chunks/CcBqEaXp.js 3.90 kB │ gzip: 1.88 kB\n.svelte-kit/output/client/_app/immutable/nodes/2.CjLXyiEO.js 5.96 kB │ gzip: 2.65 kB\n.svelte-kit/output/client/_app/immutable/nodes/0.BWrMvXMh.js 6.60 kB │ gzip: 2.78 kB\n.svelte-kit/output/client/_app/immutable/entry/app.Dr1lJFqQ.js 6.90 kB │ gzip: 3.16 kB\n.svelte-kit/output/client/_app/immutable/chunks/DWPDpZGV.js 13.45 kB │ gzip: 5.56 kB\n.svelte-kit/output/client/_app/immutable/nodes/4.DBWgfVol.js 15.87 kB │ gzip: 7.27 kB\n.svelte-kit/output/client/_app/immutable/chunks/C3mfulhw.js 33.28 kB │ gzip: 12.93 kB\n✓ built in 334ms\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-greek-ext-400-normal.BEhC8Nsh.woff 6.60 kB\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-cyrillic-400-normal.Dq7SlH2J.woff 7.09 kB\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-greek-ext-400-normal.CsqI23CO.woff2 7.51 kB\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-greek-400-normal.DUeQbRz0.woff 8.46 kB\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-latin-ext-400-normal.lWlD_NAB.woff 9.09 kB\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-cyrillic-400-normal.36-45Uyg.woff2 9.10 kB\n.svelte-kit/output/server/.vite/manifest.json 9.88 kB\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-greek-400-normal.C3zng6O6.woff2 10.52 kB\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-latin-ext-400-normal.D6XfiR-_.woff2 11.36 kB\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-cyrillic-ext-400-normal.0xXfcOOq.woff 12.91 kB\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-latin-400-normal.g4W12wf9.woff 13.51 kB\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-cyrillic-ext-400-normal.B04YIrm4.woff2 15.77 kB\n.svelte-kit/output/server/_app/immutable/assets/fira-mono-latin-400-normal.DKjLVgQi.woff2 16.28 kB\n.svelte-kit/output/server/_app/immutable/assets/svelte-welcome.0pIiHnVF.webp 115.47 kB\n.svelte-kit/output/server/_app/immutable/assets/svelte-welcome.VNiyy3gC.png 360.81 kB\n.svelte-kit/output/server/_app/immutable/assets/_page.Dv9QCmvw.css 0.74 kB\n.svelte-kit/output/server/_app/immutable/assets/_page.DyB6JVG_.css 1.35 kB\n.svelte-kit/output/server/_app/immutable/assets/_page.yeGN9jlM.css 3.69 kB\n.svelte-kit/output/server/_app/immutable/assets/_layout.BrsrMd7_.css 5.43 kB\n.svelte-kit/output/server/chunks/false.js 0.45 kB\n.svelte-kit/output/server/chunks/index4.js 0.49 kB\n.svelte-kit/output/server/entries/pages/_page.ts.js 0.51 kB\n.svelte-kit/output/server/entries/pages/about/_page.ts.js 0.59 kB\n.svelte-kit/output/server/entries/pages/sverdle/how-to-play/_page.ts.js 0.60 kB\n.svelte-kit/output/server/chunks/_sentry-release-injection-file.js 0.62 kB\n.svelte-kit/output/server/internal.js 0.78 kB\n.svelte-kit/output/server/entries/fallbacks/error.svelte.js 0.79 kB\n.svelte-kit/output/server/chunks/index3.js 0.82 kB\n.svelte-kit/output/server/chunks/escaping.js 0.94 kB\n.svelte-kit/output/server/chunks/attributes.js 1.11 kB\n.svelte-kit/output/server/chunks/equality.js 1.27 kB\n.svelte-kit/output/server/entries/pages/about/_page.svelte.js 1.35 kB\n.svelte-kit/output/server/chunks/client.js 1.36 kB\n.svelte-kit/output/server/entries/pages/sverdle/how-to-play/_page.svelte.js 2.15 kB\n.svelte-kit/output/server/chunks/index.js 2.51 kB\n.svelte-kit/output/server/chunks/index2.js 3.74 kB\n.svelte-kit/output/server/entries/pages/_layout.svelte.js 6.49 kB\n.svelte-kit/output/server/entries/pages/sverdle/_page.svelte.js 6.63 kB\n.svelte-kit/output/server/chunks/exports.js 7.29 kB\n.svelte-kit/output/server/entries/pages/_page.svelte.js 8.87 kB\n.svelte-kit/output/server/chunks/internal.js 16.65 kB\n.svelte-kit/output/server/chunks/runtime.js 27.68 kB\n.svelte-kit/output/server/index.js 99.13 kB\n.svelte-kit/output/server/entries/pages/sverdle/_page.server.ts.js 146.71 kB\n✓ built in 1.60s\n\nRun npm run preview to preview your production build locally.\n\n> Using @sveltejs/adapter-auto\n Could not detect a supported production environment. See https://svelte.dev/docs/kit/adapters to learn how to configure your app to run on the platform of your choosing\n ✔ done\n```","author":{"url":"https://github.com/giacomoran","@type":"Person","name":"giacomoran"},"datePublished":"2025-02-14T13:10:39Z","url":"https://github.com/getsentry/sentry-javascript/issues/15414"}
| 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:ef41d292-ffd0-0db9-e19f-6abc96080f80 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D010:B8CC8:112648F:1769F7D:6B0405E8 |
| html-safe-nonce | b5ab84295a3e766023d8544d4b97c1de10becb64f01a3870d3421c20ffc35f45 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDEwOkI4Q0M4OjExMjY0OEY6MTc2OUY3RDo2QjA0MDVFOCIsInZpc2l0b3JfaWQiOiI5MTQ0MDI2MjQxNTkzMjQ3MjA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a24201f3993500d22d1faf935249392a200c2518cafdfcc6f06cbf72e60b157a |
| hovercard-subject-tag | issue:2853690074 |
| 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/15414/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e775f1a8f6b5b6afc0c2179e25376b1c5985f2a807897020a8d3f74009752938/getsentry/sentry-javascript/issues/15414 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e775f1a8f6b5b6afc0c2179e25376b1c5985f2a807897020a8d3f74009752938/getsentry/sentry-javascript/issues/15414 |
| 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 | giacomoran |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| 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