Skip to content

[Feature] Source map read errors are silently swallowed during source map conversion #2914

Description

@EmmaYuan1015

Description

SourceMapsCombinator.convert wraps source map loading in a try/finally block and returns the accumulated result from finally.

A return statement inside finally overrides exceptions thrown while reading or parsing a source map. As a result, missing files, permission failures, and malformed source maps are silently treated as if no source map were available.

Expected behavior

Errors raised while reading or parsing a source map should propagate to the caller so that the conversion failure can be diagnosed and handled appropriately.

Actual behavior

The exception is suppressed and conversion either continues or returns the original bundle source map. This can result in incorrect breakpoint or stack-frame mapping without exposing the underlying cause.

Proposed fix

Remove the try/finally wrapper and return normally after loading the source map consumer:

const consumer = this.getSourceMapConsumerFrom(file);
if (consumer) {
    result[file] = consumer;
}
return result;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions