Closed niksy closed 6 months ago
Hey @niksy thanks for writing in!
To debug this, would you mind sharing your vite plugin config?
It could be well-related to self-hosted and uploadLegacySourcemaps
. Which makes this extra hard to debug 😅
are you able to update to the latest self-hosted version of Sentry? If so, I think the simpler, debug-id based source map upload apporach should work (tagging @lforst to confirm).
To debug this, would you mind sharing your vite plugin config?
Sure, no problem, here it is:
sentryVitePlugin({
url: "",
org: "",
project: "",
authToken: "",
sourcemaps: {
rewriteSources: (source) => "./" + source.replaceAll("../", ""),
},
release: {
name: commitSha,
uploadLegacySourcemaps: path.resolve(cwd, "ssr-dist"),
},
});
are you able to update to the latest self-hosted version of Sentry?
I’ll see what I can do, it would be great if this is fixed just with version bump, it looks like our self-hosted instance version is almost 2 years old 😄
Unfortunately, we’re currently unable to easily upgrade our Sentry instance 😞
One question: Did you look at the sources
field of the uploaded artifact (in Sentry) or the local file? sourcemaps.rewriteSources
only affects the uploaded artifacts.
@lforst I’ve looked in both places, local and I’ve downloaded uploaded artifact - there isn’t any rewrite done for paths.
I suppose this is something that Sentry Vite plugin should be doing?
@niksy okay thank you! I will take a look.
@niksy Hey, I just took another look. I realized you were using uploadLegacySourcemaps
to upload the source maps. The upload process that is kicked off when using that option does not consider any options in the sourcemaps
field. If you want to transform sourcemaps when using uploadLegacySourcemaps
, I recommend looking into the specific options instead.
I think we can do a better job documenting this. Sorry about that.
Okay, thank you for a fast response!
Environment
Steps to Reproduce
sourcemaps.rewriteSources: (source) => './' + source.replaceAll('../', '')
Expected Result
Source from source map should be translated to value defined in
rewriteSources
hook, e.g.../
should be stripped and./
should be prepended to source path.Actual Result
Default value is used which is relative path from
process.cwd()
, but I’m not sure if that’s valid - I’ve tried to change code directly inside default hook but changes are not applied.I’m also using
RewriteFrames
integration, but I haven’t seen any changes if it’s removed.Is this maybe related to self-hosted Sentry? For upload to work I had to use
release.uploadLegacySourcemaps
option so maybe these changes don’t get applied?