Repository navigation
Closed
Labels
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/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/sveltekit
SDK Version
8.12.0
Framework Version
2.5.7
Link to Sentry event
No response
SDK Setup
In hooks.client.ts:
Sentry.init({
dsn: PUBLIC_SENTRY_DSN,
sampleRate: dev ? 0 : 1,
tracesSampleRate: dev ? 0 : 1,
replaysSessionSampleRate: environment === 'production' ? 0.1 : 0,
replaysOnErrorSampleRate: environment === 'production' ? 0.1 : 0,
integrations: environment === 'production' ? [Sentry.replayIntegration()] : [],
debug: dev,
environment,
normalizeDepth: 10
});
In hooks.server.ts:
Sentry.init({
dsn: PUBLIC_SENTRY_DSN,
sampleRate: dev ? 0 : 1,
tracesSampleRate: dev ? 0 : 1,
debug: dev,
environment,
normalizeDepth: 10
});
My vite.config.ts:
import { paraglide } from '@inlang/paraglide-js-adapter-sveltekit/vite';
import { sentrySvelteKit } from '@sentry/sveltekit';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
// @ts-expect-error mode is not defined in vite config
export default ({ mode }) => {
return defineConfig({
build: { sourcemap: true },
plugins: [
paraglide({
project: './project.inlang',
outdir: './src/lib/paraglide'
}),
sentrySvelteKit({
sourceMapsUploadOptions: {
org: '4eign',
project: 'platform',
authToken: process.env.SENTRY_AUTH_TOKEN_USER,
sourcemaps: {
filesToDeleteAfterUpload: [ './**/*.map' ]
}
},
debug: mode === 'development',
adapter: 'vercel'
}),
sveltekit()
],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
}
});
};
Steps to Reproduce
- Deploy to vercel (running
vite build) - Expect that sourcemaps have been deleted and are not visible in browser devtools
- Observe that:
- they have not been deleted (still visible in vercel source output)
- they are still visible in browser devtools
Expected Result
Deleted sourcemaps
Actual Result
Visible sourcemaps
Reacted by Dollan and Emil Celustka
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status
Activity
s1gr1d commentedon Jun 27, 2024
Hello, thanks for reporting! Can you please share a reproduction example? This can be a GitHub repository, Stackblitz, Codesandbox or similar. This will help us investigate the issue.
jerriclynsjohn commentedon Jun 28, 2024
I'm facing a similar situation, same config as above but my build breaks with the following error
error during build: Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit: (sentry-file-deletion-plugin) writeBundle at process.handleBeforeExit (file:///....................../sample-app/node_modules/.pnpm/rollup@4.18.0/node_modules/rollup/dist/es/shared/node-entry.js:20111:28) at Object.onceWrapper (node:events:633:26) at process.emit (node:events:530:35) at process._0x24b8d6 [as emit] (/Users/...../.vscode/extensions/wallabyjs.console-ninja-1.0.326/out/buildHook/index.js:1:219762) ELIFECYCLE Command failed with exit code 1. failed to wait for command termination: exit status 1louiskhub commentedon Jun 28, 2024
Yes, will do, as soon as I find time.
jerriclynsjohn commentedon Jun 29, 2024
Here's a repro repo https://github.com/jerriclynsjohn/sveltekit-sentry-integration.git
Sentry Sourcemaps upload + delete bug
Config + Error
Config + Error for when using
unstable_sentryVitePluginOptionslforst commentedon Jul 1, 2024
Can you guys try version
8.13.0of the SDK? Thanks!60 remaining items
dollannn commentedon Oct 26, 2024
Hello, I am having the same issue related to sourcemap deletion but not vercel. I am only getting this error while enabling sourcemap deletion with the same glob pattern as OP.
Also using sveltekit on windows, macos and linux
lforst commentedon Oct 28, 2024
@dollannn please open a separate issue with reproduction steps. Thank you!
Lms24 commentedon Jan 13, 2025
Hi, I'm going to close this issue because #14942 should fix the bug that was reported in the comments here as well as in #14131.
To summarize:
@sentry/sveltekitSDK will be released soon and it will include a fix for the "This happens when Promises returned by plugins cannot resolve" bug.Please let me know if this specific issue should be reopened. In case your issue is only related but not the same, please open a new issue. Thanks!
jerriclynsjohn commentedon Jan 15, 2025
@Lms24 is this going to be part of the v9 release?
Lms24 commentedon Jan 17, 2025
@jerriclynsjohn it was released with 8.49.0 via #14963 but of course it will also be included in v9. Furthermore, there's another change coming in v9 which will auto-delete source maps under certain conditions. More info in #13993
jerriclynsjohn commentedon Jan 17, 2025
@Lms24 Tested this and works like a charm! I truly appreciate all the effort you and your team took for doing this. This is awesome!
For anyone looking for a sample repo - https://github.com/jerriclynsjohn/paraglide-sentry
Production site - https://paraglide-sentry.vercel.app/ You can see that sourcemaps are not uploaded under Source
Lms24 commentedon Jan 17, 2025
Appreciate you testing this and reporting back. Glad it works now. Thanks!
ProdanSergey commentedon Jan 22, 2025
I can confirm that the fix works perfectly for my case. Thanks to all of you who made it happen! 🫡