Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 70f228b

Browse files
authored
More useful Error in import onerror (#403)
See getsentry/sentry-javascript#2546 (comment)
1 parent bd32a27 commit 70f228b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bundler/mod.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export const bundlerRuntimeCode = `
3737
e.onload = function() {
3838
y(a[s]);
3939
};
40-
e.onerror = n;
40+
e.onerror = function(g) {
41+
n(new Error('script failed to load ' + g.target.src));
42+
};
4143
p += f;
4244
if (r) {
4345
p += '?t=' + (new Date).getTime();

0 commit comments

Comments
 (0)