Skip to content

Add note specifying Source Map directive is mandatory#1145

Closed
ndmanvar wants to merge 1 commit intomasterfrom
add-smurl-note-upload
Closed

Add note specifying Source Map directive is mandatory#1145
ndmanvar wants to merge 1 commit intomasterfrom
add-smurl-note-upload

Conversation

@ndmanvar
Copy link
Contributor

@ndmanvar ndmanvar commented Nov 21, 2017

Before submitting a pull request, please verify the following:

  • If you've added code that should be tested, please add tests.
  • If you've modified the API (e.g. added a new config or public method), update the docs and TypeScript declaration file.
  • Ensure your code lints and the test suite passes (npm test).

@kamilogorek
Copy link
Contributor

@MaxBittker
Copy link
Contributor

MaxBittker commented Nov 22, 2017

When Sentry encounters such a directive, it will resolve the source map URL relative the source file in which it is found, and attempt an HTTP request to fetch it.

^to me, this is the misleading sentence

@benvinegar
Copy link
Contributor

+Note: You must have the source map directive (//# sourceMappingURL=...app.js.map) present on the last line of the minified file in order for un-minfication to occur.

The SourceMap HTTP header can also be present.

Hmm, I guess that header isn't mentioned anywhere in the docs.

@ndmanvar
Copy link
Contributor Author

@benvinegar
Does this mean you can set the SourceMap HTTP header when uploading the minified js file, in place of having sourceMappingURL=.... at the end of the minified file? Is that correct? (Just want to make sure I'm on the same page before I start writing documentation)

@benvinegar
Copy link
Contributor

Does this mean you can set the SourceMap HTTP header when uploading the minified js file, in place of having sourceMappingURL=.... at the end of the minified file? Is that correct? (Just want to make sure I'm on the same page before I start writing documentation)

I think so but I've never verified personally.

Don't forget you can also have the minified files hosted publicly return the SourceMap header, but have the source maps privately hosted on Sentry (or vice versa, though there's hardly a good reason to do that).

@dcramer
Copy link
Member

dcramer commented Nov 27, 2017

SourceMap can also be set when you upload the artifact, effectively letting you point to an arbitrary sourcemap bundle without ever declaring anything in your minified files. That's probably the main use case for the header.

(you pass it via headers on the artifact endpoint)

@ndmanvar
Copy link
Contributor Author

ndmanvar commented Dec 8, 2017

Will add documentation about the headers piece as well (i.e. don't merge this PR yet, will add some more docs clarifying on how source map linking works / what is required for proper expanding sources.

@ndmanvar ndmanvar closed this Jan 11, 2018
@kamilogorek kamilogorek deleted the add-smurl-note-upload branch January 23, 2018 13:40
chargome added a commit that referenced this pull request Mar 17, 2026
Fixes Dependabot alerts #1142 and #1145.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
chargome added a commit that referenced this pull request Mar 18, 2026
Fixes Dependabot alerts #1142 and #1145.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants