-
-
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
Sourcemaps not deleted after upload for Sveltekit deployed to Vercel #12660
Comments
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. |
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/[email protected]/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 1 |
Yes, will do, as soon as I find time. |
Here's a repro repo https://github.com/jerriclynsjohn/sveltekit-sentry-integration.git Sentry Sourcemaps upload + delete bugConfig + Errorexport default defineConfig({
plugins: [sentrySvelteKit({
debug: true,
sourceMapsUploadOptions: {
telemetry: false,
org: "sample-org",
project: "sourcemap",
authToken: process.env.SENTRY_AUTH_TOKEN,
sourcemaps: {
filesToDeleteAfterUpload: [`./svelte-kit/**/*.map`]
}
},
}), sveltekit()]
}); [Sentry SvelteKit Plugin] Detected SvelteKit vercel adapter
[Source Maps Plugin] Enabeling source map generation
vite v5.3.2 building SSR bundle for production...
✓ 98 modules transformed.
[sentry-vite-plugin] Debug: Waiting for dependencies on generated files to be freed before deleting...
x Build failed in 4.23s
[Source Maps Plugin] Looking up source maps in /Users/............/CodeBase/TestBase/Svelte/sentry/upload-sourcemap/.svelte-kit/output
[Source Maps Plugin] Flattening source maps
[sentry-vite-plugin] Debug: No `sourcemaps.assets` option provided, falling back to uploading detected build artifacts.
> Found 24 files
> Analyzing 24 sources
> Analyzing completed in 0.026s
> Adding source map references
> Bundling completed in 0.021s
> Bundled 24 files for upload
> Bundle ID: 1c962ae5-34c3-5020-b2d5-a55e6b8eeb26
> Optimizing completed in 0.001s
> Uploading completed in 0.983s
> Uploaded files to Sentry
> Processing completed in 0.45s
> File upload complete (processing pending on server)
> Organization: zipper-school
> Project: sourcemap
> Release: 572ba3bce3414f329700f0f5ff7fa082
> Dist: None
> Upload type: artifact bundle
Source Map Upload Report
Scripts
~/1179ab9f-8021-446d-8010-c8c41fcb5fff-3.js (sourcemap at internal.js.map, debug id 1179ab9f-8021-446d-8010-c8c41fcb5fff)
~/199572b9-3da7-4cd5-b860-323b3c15a2cf-0.js (sourcemap at _sentry-release-injection-file.js.map, debug id 199572b9-3da7-4cd5-b860-323b3c15a2cf)
~/307a417a-3e1a-4049-aa29-11ea8dd16b47-7.js (sourcemap at layout.svelte.js.map, debug id 307a417a-3e1a-4049-aa29-11ea8dd16b47)
~/46e0bb51-ffad-46eb-8d10-1f4ab4a931b8-4.js (sourcemap at ssr.js.map, debug id 46e0bb51-ffad-46eb-8d10-1f4ab4a931b8)
~/52f9c181-b447-45f0-9a06-131f2e3f614c-5.js (sourcemap at _server.js.map, debug id 52f9c181-b447-45f0-9a06-131f2e3f614c)
~/7c165ca5-709e-4d1b-b9d8-483a11152de2-9.js (sourcemap at _page.svelte.js.map, debug id 7c165ca5-709e-4d1b-b9d8-483a11152de2)
~/a232d7b6-1ee5-4f34-b8cf-5dddc1a9a65c-10.js (sourcemap at index.js.map, debug id a232d7b6-1ee5-4f34-b8cf-5dddc1a9a65c)
~/abf06399-4103-4360-b840-e4a6374ad440-8.js (sourcemap at _page.svelte.js.map, debug id abf06399-4103-4360-b840-e4a6374ad440)
~/bae66a35-3eec-43be-ab49-e3d845cb9f67-6.js (sourcemap at error.svelte.js.map, debug id bae66a35-3eec-43be-ab49-e3d845cb9f67)
~/bdc72d9c-6d59-400c-9a20-b852086412f2-1.js (sourcemap at exports.js.map, debug id bdc72d9c-6d59-400c-9a20-b852086412f2)
~/e5c5a9b4-9400-4c39-a906-86b84bf93c76-11.js (sourcemap at internal.js.map, debug id e5c5a9b4-9400-4c39-a906-86b84bf93c76)
~/f188f204-5d53-48f9-95dc-730a3a4e6d08-2.js (sourcemap at hooks.server.js.map, debug id f188f204-5d53-48f9-95dc-730a3a4e6d08)
Source Maps
~/1179ab9f-8021-446d-8010-c8c41fcb5fff-3.js.map (debug id 1179ab9f-8021-446d-8010-c8c41fcb5fff)
~/199572b9-3da7-4cd5-b860-323b3c15a2cf-0.js.map (debug id 199572b9-3da7-4cd5-b860-323b3c15a2cf)
~/307a417a-3e1a-4049-aa29-11ea8dd16b47-7.js.map (debug id 307a417a-3e1a-4049-aa29-11ea8dd16b47)
~/46e0bb51-ffad-46eb-8d10-1f4ab4a931b8-4.js.map (debug id 46e0bb51-ffad-46eb-8d10-1f4ab4a931b8)
~/52f9c181-b447-45f0-9a06-131f2e3f614c-5.js.map (debug id 52f9c181-b447-45f0-9a06-131f2e3f614c)
~/7c165ca5-709e-4d1b-b9d8-483a11152de2-9.js.map (debug id 7c165ca5-709e-4d1b-b9d8-483a11152de2)
~/a232d7b6-1ee5-4f34-b8cf-5dddc1a9a65c-10.js.map (debug id a232d7b6-1ee5-4f34-b8cf-5dddc1a9a65c)
~/abf06399-4103-4360-b840-e4a6374ad440-8.js.map (debug id abf06399-4103-4360-b840-e4a6374ad440)
~/bae66a35-3eec-43be-ab49-e3d845cb9f67-6.js.map (debug id bae66a35-3eec-43be-ab49-e3d845cb9f67)
~/bdc72d9c-6d59-400c-9a20-b852086412f2-1.js.map (debug id bdc72d9c-6d59-400c-9a20-b852086412f2)
~/e5c5a9b4-9400-4c39-a906-86b84bf93c76-11.js.map (debug id e5c5a9b4-9400-4c39-a906-86b84bf93c76)
~/f188f204-5d53-48f9-95dc-730a3a4e6d08-2.js.map (debug id f188f204-5d53-48f9-95dc-730a3a4e6d08)
[sentry-vite-plugin] Info: Successfully uploaded source maps to Sentry
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:///Users/.........../CodeBase/TestBase/Svelte/sentry/upload-sourcemap/node_modules/.pnpm/[email protected]/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. Config + Error for when using
|
Can you guys try version |
it is "dependencies": {
"@sentry/sveltekit": "^8.13.0",
"dotenv": "^16.4.5"
} |
We'll take a look at this soon. |
@lforst Any updates, mate? Let me know if we can play around with a workaround while you look into it. |
We just found the cause for this but a fix might still take a while. My recommended workaround for now is to not use For the interested and for posterity: This issue is caused because the Sveltekit SDK moves the upload plugin into bundle close hook. This causes the created upload plugin task to never complete (because it hasn't run yet) when the deletion plugin runs - basically causing a deadlock. |
It turns out that using |
Thanks for taking a look @dummdidumm! |
Hello, @Lms24. Is Vercel team aware of it? |
@ProdanSergey the comment above is from a Vercel employee. |
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 |
@dollannn please open a separate issue with reproduction steps. Thank you! |
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:
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! |
@Lms24 is this going to be part of the v9 release? |
@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 |
@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 |
Appreciate you testing this and reporting back. Glad it works now. Thanks! |
I can confirm that the fix works perfectly for my case. Thanks to all of you who made it happen! 🫡 |
Is there an existing issue for this?
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
:In
hooks.server.ts
:My
vite.config.ts
:Steps to Reproduce
vite build
)Expected Result
Deleted sourcemaps
Actual Result
Visible sourcemaps
The text was updated successfully, but these errors were encountered: