Skip to content

sentry-cli sourcemaps inject fails if any embedded source map has errors #1918

Open

Description

Environment

macOS 14.3, sentry-cli 2.26.0

Steps to Reproduce

  1. add a file with an embedded source map containing "version": 3.0 (note the floating point version number) to your project, or add a dependency on xml2js 0.6.2 which contains such an erroneous source map.
  2. run sentry-cli sourcemaps inject

Expected Result

Debug IDs would be injected in all valid source maps, and perhaps a warning would be printed about source maps with errors.

Actual Result

sentry-cli exited with an error as soon as it encountered the erroneous source map.

Logs

> Injecting debug ids
error: Invalid embedded sourcemap in source file {source_url}
  caused by: bad json: invalid type: floating point `3`, expected u32 at line 1 column 14

Note that the error reporting also has a bug, printing a literal {source_url} instead of the actual URL, that's fixed in #1917

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions