Skip to content

Commit eb3407b

Browse files
author
Luca Forstner
authored
fix(core): Don't abort source map location guessing when the reference is a URL (#424)
1 parent abf08f0 commit eb3407b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

packages/bundler-plugin-core/src/debug-id-upload.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,19 +332,21 @@ async function determineSourceMapPathFromBundle(
332332
if (isSupportedUrl) {
333333
absoluteSourceMapPath = sourceMappingUrl;
334334
} else if (isUrl) {
335-
return;
335+
// noop
336336
} else if (path.isAbsolute(sourceMappingUrl)) {
337337
absoluteSourceMapPath = sourceMappingUrl;
338338
} else {
339339
absoluteSourceMapPath = path.join(path.dirname(bundlePath), sourceMappingUrl);
340340
}
341341

342-
try {
343-
// Check if the file actually exists
344-
await util.promisify(fs.access)(absoluteSourceMapPath);
345-
return absoluteSourceMapPath;
346-
} catch (e) {
347-
// noop
342+
if (absoluteSourceMapPath) {
343+
try {
344+
// Check if the file actually exists
345+
await util.promisify(fs.access)(absoluteSourceMapPath);
346+
return absoluteSourceMapPath;
347+
} catch (e) {
348+
// noop
349+
}
348350
}
349351
}
350352

0 commit comments

Comments
 (0)