Skip to content

Instantly share code, notes, and snippets.

@ValentinFunk
Created April 12, 2017 18:46
Show Gist options
  • Save ValentinFunk/8f6ad2f6c91cabbe15ad7ac04b1efc81 to your computer and use it in GitHub Desktop.
Save ValentinFunk/8f6ad2f6c91cabbe15ad7ac04b1efc81 to your computer and use it in GitHub Desktop.

Hi,

thanks for the speedy response. The devtool setting is set to hidden-source-map. I've just skimmed the plugin's source code and it does not set any header. Does that mean that when uploading a sourcemap without a comment reference in the minified file i need to set a HTTP header when uploading?

I've tried reading the CLI's source for some information and it seems that a x-sourcemap header is set. (Unfortunately https://docs.sentry.io/api/releases/post-release-files/ does not provide any information on this). I'll make a pull request for the webpack plugin to include that header if this is the case.

What format should the header value have? E.g. I have a file index.bundle.js and index.bundle.js.map, do i set it to ~/index.bundle.js?

Also, does the header refer to the header field in the POST body of /api/0/projects/{organization_slug}/{project_slug}/releases/{version}/files/ or is it a header that should be set when uploading a file to /api/0/projects/{organization_slug}/{project_slug}/releases/{version}/files/?

Thanks, Valentin

Hi,

If you do not have a sourcemap reference you (eg: hidden sourcemap) then you need to upload minified files as well as maps to us. (we don't need the non minified files). In that minified file you can then add the comment or alternatively the header. This is what sentry-cli does automatically. That header should be set to the name of the sourcemap file without anything else (assuming it's in the same location).

The header is no longer called x-sourcemap, it's just sourcemap now but we support both. On the API it's set as a general header on file upload. eg: header=Sourcemap:myfile.min.js.map or something similar.

Regards, Armin

And yes to clarify this: it goes into the post body on the API as shown in the example.

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