-
Notifications
You must be signed in to change notification settings - Fork 36
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
Sentry source maps completely incorrect and showing sentry debug stuff? #575
Comments
Hello, thanks for writing. Seeing Sentry debug code should not be the case. Do you maybe use other plugins that modify your sourcemaps? And it would be great to get a small reproduction example from you, so we can look into this. |
Hey @s1gr1d I'm also having the same issue, which seems to be related to #471, as in the source maps I'm getting for example: import "_sentry-debug-id-injection-stub";
import * as aModule from "/path/to/file.js";
export default aModule.default;
export * from "/path/to/file.js"; Which raises the I tried to remove all plugins and use the simplest possible config, but the only way to fix the esbuild's source maps is not using sentry, which is kind of the reason I need source maps in the first place 😅 I don't quite get how other people are using this esbuild plugin, maybe it broke recently? |
@aleesaan would you mind sharing your code or a minimal reproduction? It would help us debug this issue effectively. |
Hey @lforst I created a small repro on stackblitz but it's probably best to try this locally to also run the app and check the source maps in the browser. Here it is: https://stackblitz.com/edit/esbuild-95tv8h?file=build.mjs You can see the compilation is giving the |
Hey @lforst I just looked more into it and it seems like we get this |
@aleesaan thanks for the repro! The source maps from your reproduction generally look fine to me. The content of the source maps may look weird but the source mapping should properly work 🤔 The "import-is-undefined" warning we cannot fix at the moment and is tracked in #471 which you already found. Do you happen to have an error and repro where the source mapping doesn't work? Also: We generally don't optimize the bundler plugins for development, and only for production builds. Any of their functionality may not work in dev servers. |
@lforst you're right, I thought |
FWIW here's an example config that's failing for me in my project: {
sourcemap: true,
entryPoints: [
...
],
bundle: true,
logLevel: 'info',
target: ['es2022'],
outdir: 'path/to/dist',
define: {
...
},
external: [
...
],
plugins: [
sentryEsbuildPlugin({
org: "org",
project: "project",
url: "url",
authToken: process.env.SENTRY_AUTH_TOKEN,
release: {
name: process.env.RELEASE,
},
}),
],
} I was using other plugins but I removed them (to isolate the issue) and it still creates wrong source maps. If I remove |
@aleesaan I am still struggling to understand the exact issue at hand 🤔 I think there might be something wrong with our plugin but can't quite put a finger on it (we're admittedly doing some shady shit because esbuild's plugin API is very restricted). Feel free to share more complicated code if it is able to reproduce! It would help a lot. |
Not sure if that can help anybody but I managed to get my source maps to work by using |
Still completely fucked for me. Every repo I try it in has the same issue. Legit I have one repo and I use a different branch per customer. My own sentry account (free tier) fucked source maps. My customers account, perfect source maps (paid tier). There is 0 difference in build/deployment code other than the paid tier on Sentry lol. |
@OultimoCoder I can confidently say that paid or not paid will not play a role in source mapping. Can you verify that you have the right auth token? |
100% have the right auth token. This occurs across every esbuild repo I have minus my customer's branch on 1 repo. In this specific instance. Both are the same repo, same dependencies (different auth token and sentry accounts). I can deploy 1, swap branch deploy the other. With debug enabled I see both are uploaded successfully. I can also double check Sentry to confirm this. The only difference is custom customer code unrelated to build or deploy. One has faulty source maps, one works perfectly. I even deleted build output between swapping branches so its 100% uploading the correct source maps. |
@OultimoCoder maybe you can isolate out what causes this in a small example, so that we can take a proper look. |
I am using cloudflare workers for all my projects. If I give you a cloudflare worker repro, do you mind? It kills me everytime I get a sentry error and its useless lol and I'm too lazy to change provider atm. |
@OultimoCoder something we can run ourselves locally without too much hassle would be great. |
The text was updated successfully, but these errors were encountered: