getsentry / sentry-javascript-bundler-plugins

JavaScript Bundler Plugins for Sentry
https://sentry.io
BSD 3-Clause "New" or "Revised" License
141 stars 36 forks source link

Using the "filesToDeleteAfterUpload" plugin setting breaks source maps with esbuild plugin #490

Closed bryansoftdev closed 9 months ago

bryansoftdev commented 9 months ago

Environment

Steps to Reproduce

I triggered a test event on AWS without changing the default values to make an error occur on purpose. I did it once without the filesToDeleteAfterUpload setting in my config, and then repeated with filesToDeleteAfterUpload set.

Expected Result

Before enabling the filesToDeleteAfterUpload setting:

image

Actual Result

After enabling the filesToDeleteAfterUpload setting:

image
lforst commented 9 months ago

NODE_OPTIONS=--enable-source-maps is generally not supported by Sentry as it makes stack traces resolve to the original location which is not what we want when source maps are uploaded. Either you remove that option or you upload sourcemaps. It seems like something didnt work in the second screenshot though. What does the unminify code button say?

bryansoftdev commented 9 months ago

@lforst Thank you, I reviewed what the button said, and I realized my version of the sentry SDK was very out of date. Updating from @sentry/serverless: 6.15.0 to ^7.56.0 fixed the problem.

The stack trace looks better now & my serverless zip has the source maps removed. 👍

image

(I also removed NODE_OPTIONS=--enable-source-maps like you said)

lforst commented 9 months ago

Awesome, glad it worked for you!