Skip to content

sentry-cli inject broken for this example #2462

@vanschelven

Description

@vanschelven

CLI Version

2.43.0

Operating System and Architecture

  • macOS (arm64)
  • macOS (x86_64)
  • Linux (i686)
  • Linux (x86_64)
  • Linux (armv7)
  • Linux (aarch64)
  • Windows (i686)
  • Windows (x86_64)

Operating System Version

Ubuntu 22.04

Link to reproduction repository

https://github.com/bugsink/mksourcemaps/tree/

CLI Command

sentry-cli sourcemaps inject .

Exact Reproduction Steps

Here's the file without any injection:

https://github.com/bugsink/mksourcemaps/blob/67a9159676d3f0b46eb8a3585f2017fd59392545/captureException.js

As per the (sentry uglifyjs) docs, do the following:

uglifyjs captureException.js   -o captureException.min.js   --source-map url=captureException.min.js.map,includeSources
sentry-cli sourcemaps inject .

The resulting sourcemap is invalid.

If you first add some newlines at the top of the file, everything works as expected.

Expected Results

.

Actual Results

.

Logs

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions