getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.94k stars 1.56k forks source link

Vercel Edge Runtime Stack Traces #6805

Open lforst opened 1 year ago

lforst commented 1 year ago

Problem Statement

The stack traces on the Vercel Edge runtime still look horrible. They seem to flow through some kind of sandbox and aren't source mapped at all.

Solution Brainstorm

We should first try to source map the events somehow by uploading the right files. If we don't come to a solution we can collaborate with the Vercel folks.

vojto commented 11 months ago

Is there no way to get stack traces in edge functions currently? This is what ours look like:

Screenshot 2023-11-06 at 11 06 52
lforst commented 11 months ago

No, unfortunately not. However, it is on our very-short-term roadmap. I might even start working on it today!

lforst commented 11 months ago

Ok, good news and bad news.

I just chatted with some people from Vercel and they said they bundle the edge functions an additional time when deploying. This means the SDK doesn't have the opportunity to upload the newly (Vercel) bundled files + sourcemaps to Sentry.

We'll brainstorm a solution for this!

lforst commented 11 months ago

Issue on the vercel repo for context: https://github.com/vercel/vercel/issues/10829

jenwoodson commented 10 months ago

Hey, @lforst, I want to double-check this is what I'm running into, and then I'll go comment on the Vercel issue. When I send edge runtime errors from my local environment, I at least get the correct file names in my stacktrace. But, the same error sent from a Vercel environment just has vc/edge/function and <anonymous>. This sounds like your good news (I can get the filenames locally) and your bad news (I can't get the filenames from Vercel), right?

local:

Screen Shot 2023-12-19 at 11 25 17 AM

Vercel:

Screen Shot 2023-12-19 at 11 25 57 AM
lforst commented 10 months ago

@jenwoodson Yes you are running into the same issue. Stack traces and source maps on Vercel are inherently broken for tools like Sentry and to fix this, Vercel would need to provide a way to access the source maps they generate after they run their additional (hidden) bundling step.

You can follow this issue for progress: https://github.com/vercel/vercel/issues/10829