Skip to content
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.deleteSourcemapsAfterUpload breaks Vercel deployment #13099

Closed
ocavue opened this issue Jul 30, 2024 · 4 comments · Fixed by #13102
Closed

sourcemaps.deleteSourcemapsAfterUpload breaks Vercel deployment #13099

ocavue opened this issue Jul 30, 2024 · 4 comments · Fixed by #13102
Labels
Feature: Source Maps Package: nextjs Issues related to the Sentry Nextjs SDK

Comments

@ocavue
Copy link

ocavue commented Jul 30, 2024

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

I'm using Vercel to deploy my Next.js project. When I enable sourcemaps: { deleteSourcemapsAfterUpload: true } in next.config.js, I get the following error from Vercel:

Error: ENOENT: no such file or directory, lstat '/vercel/path0/.next/server/chunks/195.js.map'

More detailed output:


Route (pages)                              Size     First Load JS
┌ ○ /                                      8.71 kB         163 kB
├   └ css/88d021db95f13dbf.css             2.02 kB
├   /_app                                  0 B             154 kB
├ ○ /404                                   438 B           155 kB
├ ƒ /api/sentry-example-api                0 B             154 kB
├ ƒ /api/test1                             0 B             154 kB
├ ƒ /api/test2                             0 B             154 kB
├ ƒ /api/test3                             0 B             154 kB
├ ƒ /api/test4                             0 B             154 kB
├ ○ /client/test1                          429 B           155 kB
├ ○ /client/test2                          456 B           155 kB
├ ○ /client/test3                          445 B           155 kB
├ ○ /client/test4                          467 B           155 kB
├ ○ /sentry-example-page                   1.86 kB         156 kB
├ ƒ /ssr/test1                             431 B           155 kB
├ ƒ /ssr/test2                             429 B           155 kB
├ ƒ /ssr/test3                             430 B           155 kB
└ ƒ /ssr/test4                             432 B           155 kB
+ First Load JS shared by all              155 kB
  ├ chunks/framework-8722668362422965.js   45.3 kB
  ├ chunks/main-4d4ce5325c2179ff.js        32.2 kB
  ├ chunks/pages/_app-c18a80145f513654.js  76 kB
  └ other shared chunks (total)            1.66 kB
○  (Static)   prerendered as static content
ƒ  (Dynamic)  server-rendered on demand

Error: ENOENT: no such file or directory, lstat '/vercel/path0/.next/server/chunks/195.js.map'

I've created a minimal repo to reproduce this issue: https://github.com/ocavue/nextjs-sentry-vercel-deploy-issue

You can see from the GitHub webpage that the Vercel deployment failed after I enable deleteSourcemapsAfterUpload.

Image

Expected Result

No error.

Actual Result

Vercel deployment fails, as shown above.

Product Area

Unknown

Link

No response

DSN

No response

Version

8.20.0

@getsantry
Copy link

getsantry bot commented Jul 30, 2024

Assigning to @getsentry/support for routing ⏲️

@ocavue
Copy link
Author

ocavue commented Jul 30, 2024

It seems that when deleteSourcemapsAfterUpload is enable, all .js.map files under .next/ are deleted. (source code)

And based on the error message above, it seems that Vercel does need .next/server/chunks/195.js.map. Maybe we should only clean .map files under .next/static/.

@InterstellarStella InterstellarStella transferred this issue from getsentry/sentry Jul 30, 2024
@getsantry getsantry bot moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 3 Jul 30, 2024
@Lms24
Copy link
Member

Lms24 commented Jul 30, 2024

Hey @ocavue thanks for writing in and thanks for providing a reproduction! I'll take a look and report back.

@Lms24
Copy link
Member

Lms24 commented Jul 30, 2024

I can reproduce the issue on Vercel (but not locally, so just like you described). Talked a bit about this with @lforst - it's probably fine for us to only delete client-side source maps and not every source map. We'll fix this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Source Maps Package: nextjs Issues related to the Sentry Nextjs SDK
Projects
Archived in project
3 participants