-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sveltekit build fails with sourcemap deletion enabled #14131
Comments
Hey, thanks for reporting! I'll take a look soon. |
Any progress on this? |
Hey, sorry for the wait! Taking a look right now |
So, I have some preliminary findings but unfortunately no fix yet. |
Any updates on this? |
Hi @dollannn, currently no updates, but we'll take another look this week! |
Got the same problem here! I would say this is an important feature. Also, this should be an option enabled by default (just like in the Next.js plugin with hideSourceMaps and deleteSourcemapsAfterUpload) Deploying the source map by default in production is not good practice! Also think the warning it should give is not triggering: sentry-javascript/packages/sveltekit/src/vite/sourceMaps.ts Lines 111 to 114 in 4415881
For now I made my own vite plugin to remove the maps from the client after build and upload: function removeSourceMapPlugin() {
return {
name: 'remove-client-source-maps',
apply: 'build',
enforce: 'post',
generateBundle(_, bundle) {
for (const file in bundle) {
if (file.endsWith('.map')) {
delete bundle[file]
}
}
}
};
} based on: vitejs/vite#12828 Included this in the vite config after the sveltekit plugin: plugins: [
sentrySvelteKit({
// CONFIG
}),
sveltekit(),
removeSourceMapPlugin()
] |
Gonna take another look today. Sorry for the wait! |
I opened #14942 to fix this, there will be an automatic response in this issue once the fix is merged and released |
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
8.35.0
Framework Version
Latest svelte
Link to Sentry event
No response
Reproduction Example/SDK Setup
Latest svelte 5 repro, I am myself using svelte 4 in the project actually being affected by this:
https://github.com/dollannn/sentry-repro
Steps to Reproduce
Enable sourcemap deletion in vite.config.ts
Try to build
Expected Result
Sourcemaps being deleted and the build not failing
Actual Result
error during build:
Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s)oon exit:
on exit:
on exit:
(sentry-file-deletion-plugin) writeBundle
at process.handleBeforeExit (file:///D:/Projects/test/sentry-repro/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:21098:28)
at Object.onceWrapper (node:events:634:26)
at process.emit (node:events:531:35)
ELIFECYCLE Command failed with exit code 1.
The text was updated successfully, but these errors were encountered: