Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/sveltekit
SDK Version
11.4.0 (also seen on 10.76.0)
Framework Version
@sveltejs/kit 3.0.0, @sveltejs/adapter-node 6.0.0, Vite 8.3.2
Link to Sentry event
No response
Reproduction Example/SDK Setup
// vite.config.ts
import { sentrySvelteKit } from '@sentry/sveltekit/vite';
sentrySvelteKit({
autoUploadSourceMaps: true,
adapter: 'node',
debug: true,
org: '...',
project: '...',
sentryUrl: '...',
sourcemaps: { assets: ['./build/**/*'] },
}),
sveltekit({ adapter: nodeAdapter, /* ... */ }),
Steps to Reproduce
- Set up SvelteKit 3 with adapter-node and sentrySvelteKit() as above, with SENTRY_AUTH_TOKEN set.
- Run vite build.
- Look in the build output for the upload logs.
Expected Result
Source maps get uploaded after the adapter runs, like on SvelteKit 2. Our last Kit 2 build logged Bundled 2433 files for upload and Uploaded files to Sentry.
Actual Result
Nothing gets uploaded and nothing about it is logged, so every client error since we upgraded to Kit 3 has minified frames. With debug: true the plugin only logs Enabled source map generation in the build options with build.sourcemap: 'hidden'. The source maps will be deleted after they were uploaded to Sentry. After that there's no upload attempt (an invalid token doesn't even produce a 401), and all .map files are still in build/, so the upload/cleanup step never runs. Chunks get the sentry-dbid-… snippet but never the //# debugId= comment.
Additional Context
I think the cause is the SSR check in sentry-sveltekit-debug-id-upload-plugin (packages/sveltekit/src/vite/sourceMaps.ts):
configResolved: config => {
// `config.build.ssr` is `true` for that first build and `false` in the other ones.
if (!config.build.ssr) {
isSSRBuild = false;
}
},
closeBundle: async () => {
if (!isSSRBuild) {
return;
}
// flatten + upload
SvelteKit 3 does a single Vite build with ssr and client environments, rather than a separate SSR build, so config.build.ssr is never true and closeBundle always returns early. #21629 fixed the same thing in autoInstrument by using this.environment.name, but sourceMaps.ts still has the old check. The sveltekit-3 e2e app doesn’t seem to test source maps, which would explain why this wasn’t caught.
Our workaround: set sourcemaps: { disable: 'disable-upload' } (on 10.x, unstable_sentryVitePluginOptions: { sourcemaps: { disable: 'disable-upload' } }) so the plugin stamps debug IDs into the output files (since #23754), then run sentry-cli sourcemaps upload build after the build.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/sveltekit
SDK Version
11.4.0 (also seen on 10.76.0)
Framework Version
@sveltejs/kit 3.0.0, @sveltejs/adapter-node 6.0.0, Vite 8.3.2
Link to Sentry event
No response
Reproduction Example/SDK Setup
Steps to Reproduce
Expected Result
Source maps get uploaded after the adapter runs, like on SvelteKit 2. Our last Kit 2 build logged Bundled 2433 files for upload and Uploaded files to Sentry.
Actual Result
Nothing gets uploaded and nothing about it is logged, so every client error since we upgraded to Kit 3 has minified frames. With debug: true the plugin only logs Enabled source map generation in the build options with build.sourcemap: 'hidden'. The source maps will be deleted after they were uploaded to Sentry. After that there's no upload attempt (an invalid token doesn't even produce a 401), and all .map files are still in build/, so the upload/cleanup step never runs. Chunks get the sentry-dbid-… snippet but never the //# debugId= comment.
Additional Context
I think the cause is the SSR check in sentry-sveltekit-debug-id-upload-plugin (packages/sveltekit/src/vite/sourceMaps.ts):
SvelteKit 3 does a single Vite build with ssr and client environments, rather than a separate SSR build, so config.build.ssr is never true and closeBundle always returns early. #21629 fixed the same thing in autoInstrument by using this.environment.name, but sourceMaps.ts still has the old check. The sveltekit-3 e2e app doesn’t seem to test source maps, which would explain why this wasn’t caught.
Our workaround: set sourcemaps: { disable: 'disable-upload' } (on 10.x, unstable_sentryVitePluginOptions: { sourcemaps: { disable: 'disable-upload' } }) so the plugin stamps debug IDs into the output files (since #23754), then run sentry-cli sourcemaps upload build after the build.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.