getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.06k stars 4.19k forks source link

Source maps don't get associated to scripts with a blob: URL #18222

Open getkey opened 4 years ago

getkey commented 4 years ago

Important Details

How are you running Sentry?

Saas (sentry.io)

Description

When an error happens in as script with a blob: URL, its source maps doesn't get associated, and error below is shown.

image

URL for which the issue happened image

But this file ends with

//# sourceMappingURL=bundle.js.map

And bundle.js.map has been uploaded to the artifacts:

image

@CaptObvious described the same issue as me here https://forum.sentry.io/t/source-maps-not-loading-for-js-blobs/3736

Steps to Reproduce

You can use the script below to use a script from a blob: URL. Just replace blobScript with a minified script and upload its sourcemap.

const blobScript = `console.log(\'Hello world!\');
throw new Error('Triggering sentry');
//# sourceMappingURL=bundle.js.map
`;
const blob = new Blob([blobScript]);
const url = URL.createObjectURL(blob);

const script = document.createElement('script');
script.setAttribute('src', url);
document.body.appendChild(script);

What you expected to happen

The same behavior as when the script is loaded with a normal URL: being able to see the error in the context of the original source.

github-actions[bot] commented 3 years ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Accepted, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

tgrant59 commented 3 years ago

I'm experiencing this a lot with mobile browsers