From 31bdbda18460bcb60f1aad5e09294de04fba203a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Wed, 25 May 2022 14:49:16 +0200 Subject: [PATCH 1/4] docs(js): Add sourcemaps explain to source maps troubleshooting guide --- .../common/sourcemaps/troubleshooting_js.mdx | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx b/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx index 0f7001e430db4..30b8f74af4381 100644 --- a/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx +++ b/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx @@ -6,7 +6,16 @@ description: "Troubleshooting for source maps." sidebar_order: 8 --- -Source maps can sometimes be tricky to get going. If you’re having trouble: +Source maps can sometimes be tricky to get going. If you are having trouble, you can try using our verification tool inside `sentry-cli`, or go through the steps listed below yourself. Please keep in mind, that the tool mentioned above is in it’s early stage, and we are actively working to improve it. + +To use the automated process, [install and configure](/product/cli/) `sentry-cli`. Once completed, use the `sourcemaps explain` command, by calling it with the event ID that can be found at the top header of the issue page, eg. `Event fdfd1337e3964cd6a4d11f35357a4c43 | JSON (42.0 KiB)`. + +```shell +sentry-cli sourcemaps explain fdfd1337e3964cd6a4d11f35357a4c43 +``` + +This should provide you with some useful hints about what exactly went wrong with the source maps setup process. +If that is not the case, let us know, so that we can make it better. @@ -14,7 +23,7 @@ Source maps can sometimes be tricky to get going. If you’re having trouble: For uploaded source maps to be located and applied, the release needs to be created by the CLI or API (and the correct artifacts uploaded with it), and the name of that newly-created release needs to be specified in your SDK configuration. -To verify this, open up the issue from the Sentry UI and check if the release is configured. If it says "_not configured_" or "_N/A_" next to **Release** on the right hand side of the screen (or if you do not see a `release` tag in the list of tags), you'll need to go back and [tag your errors](../../configuration/releases/). If this is properly set up you'll see "Release: my_example_release". +To verify this, open up the issue from the Sentry UI and check if the release is configured. If it says "_not configured_" or "_N/A_" next to **Release** on the right hand side of the screen (or if you do not see a `release` tag in the list of tags), you will need to go back and [tag your errors](../../configuration/releases/). If this is properly set up you will see "Release: my_example_release". @@ -45,7 +54,7 @@ To verify that the distribution has been set correctly in the SDK, open an issue ## Verify artifact names match stack trace frames -If you’ve uploaded source maps and they aren’t applying to your code in an issue in Sentry, take a look at the JSON of the event and look for the `abs_path` to see exactly where we’re attempting to resolve the file - for example, `http://localhost:8000/scripts/script.js` (`abs_path` will appear once for each frame in the stack trace - match this up with the file(s) that are not deminified.). A link to the JSON view can be found at the top of the issue page next to the date the event occurred. The uploaded artifact names must match these values. +If you have uploaded source maps and they are not applying to your code in an issue in Sentry, take a look at the JSON of the event and look for the `abs_path` to see exactly where we are attempting to resolve the file - for example, `http://localhost:8000/scripts/script.js` (`abs_path` will appear once for each frame in the stack trace - match this up with the file(s) that are not deminified.). A link to the JSON view can be found at the top of the issue page next to the date the event occurred. The uploaded artifact names must match these values. If you have **dynamic values in your path** (for example, `https://www.site.com/{some_value}/scripts/script.js`), you may want to use the `rewriteFrames` integration to change your `abs_path` values. @@ -58,7 +67,7 @@ If your `sourceMappingURL` comment is similar to: //# sourceMappingURL=script.min.js.map ``` -An example `sentry-cli` command to upload these files correctly would look like this (assuming you’re in the `/scripts` directory, running your web server from one directory higher, which is why we’re using the `--url-prefix` option): +An example `sentry-cli` command to upload these files correctly would look like this (assuming you are in the `/scripts` directory, running your web server from one directory higher, which is why we are using the `--url-prefix` option): ```shell sentry-cli releases files VERSION upload-sourcemaps . --url-prefix '~/scripts' @@ -158,7 +167,7 @@ First, install `source-map` globally as an npm module: npm install -g source-map ``` -Then, write a script that reads your source map file and tests a mapping. Here’s an example: +Then, write a script that reads your source map file and tests a mapping. Here is an example: ```javascript var fs = require("fs"), @@ -194,7 +203,7 @@ Often users hit this limit because they are transmitting source files at an inte The Sentry API currently only works with source maps and source files that are uploaded as plain text (UTF-8 encoded). If the files are uploaded in a compressed format (for example, gzip), they will be not be interpreted correctly. -This sometimes occurs with build scripts and plugins that produce pre-compressed minified files. For example, Webpack’s [compression plugin](https://github.com/webpack/compression-webpack-plugin). You’ll need to disable such plugins and perform the compression _after_ the generated source maps/source files have been uploaded to Sentry. +This sometimes occurs with build scripts and plugins that produce pre-compressed minified files. For example, Webpack’s [compression plugin](https://github.com/webpack/compression-webpack-plugin). You will need to disable such plugins and perform the compression _after_ the generated source maps/source files have been uploaded to Sentry. ## Verify workers are sharing the same volume as web (if running self-hosted Sentry via Docker) From eb8ef982b7e90f820fe8dd3a7502d8ddf9d7ef8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Wed, 25 May 2022 17:11:32 +0200 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> --- .../common/sourcemaps/troubleshooting_js.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx b/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx index 30b8f74af4381..b55e6575ab8a2 100644 --- a/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx +++ b/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx @@ -6,16 +6,16 @@ description: "Troubleshooting for source maps." sidebar_order: 8 --- -Source maps can sometimes be tricky to get going. If you are having trouble, you can try using our verification tool inside `sentry-cli`, or go through the steps listed below yourself. Please keep in mind, that the tool mentioned above is in it’s early stage, and we are actively working to improve it. +Source maps can sometimes be tricky to get going. If you're having trouble, you can try using our verification tool inside `sentry-cli`, or go through the steps listed below yourself. Please keep in mind, that the `sentry-cli` is a work-in-progress, and we are actively working to improve it. -To use the automated process, [install and configure](/product/cli/) `sentry-cli`. Once completed, use the `sourcemaps explain` command, by calling it with the event ID that can be found at the top header of the issue page, eg. `Event fdfd1337e3964cd6a4d11f35357a4c43 | JSON (42.0 KiB)`. +To use the automated verification process, [install and configure](/product/cli/) `sentry-cli`. Once completed, use the `sourcemaps explain` command, by calling it with the event ID that can be found at the top of the **Issue Details** page in [sentry.io](https://sentry.io). For example, "Event fdfd1337e3964cd6a4d11f35357a4c43 | JSON (42.0 KiB)". ```shell sentry-cli sourcemaps explain fdfd1337e3964cd6a4d11f35357a4c43 ``` This should provide you with some useful hints about what exactly went wrong with the source maps setup process. -If that is not the case, let us know, so that we can make it better. +If it doesn't, let us know so we can make it better. @@ -23,7 +23,7 @@ If that is not the case, let us know, so that we can make it better. For uploaded source maps to be located and applied, the release needs to be created by the CLI or API (and the correct artifacts uploaded with it), and the name of that newly-created release needs to be specified in your SDK configuration. -To verify this, open up the issue from the Sentry UI and check if the release is configured. If it says "_not configured_" or "_N/A_" next to **Release** on the right hand side of the screen (or if you do not see a `release` tag in the list of tags), you will need to go back and [tag your errors](../../configuration/releases/). If this is properly set up you will see "Release: my_example_release". +To verify this, open up the issue from the Sentry UI and check if the release is configured. If it says "_not configured_" or "_N/A_" next to **Release** on the right hand side of the screen (or if you do not see a `release` tag in the list of tags), you'll need to go back and [tag your errors](../../configuration/releases/). If this is properly set up you'll see "Release: my_example_release". @@ -54,7 +54,7 @@ To verify that the distribution has been set correctly in the SDK, open an issue ## Verify artifact names match stack trace frames -If you have uploaded source maps and they are not applying to your code in an issue in Sentry, take a look at the JSON of the event and look for the `abs_path` to see exactly where we are attempting to resolve the file - for example, `http://localhost:8000/scripts/script.js` (`abs_path` will appear once for each frame in the stack trace - match this up with the file(s) that are not deminified.). A link to the JSON view can be found at the top of the issue page next to the date the event occurred. The uploaded artifact names must match these values. +If you’ve uploaded source maps and they aren’t applying to your code in an issue in Sentry, take a look at the JSON of the event and look for the `abs_path` to see exactly where we’re attempting to resolve the file - for example, `http://localhost:8000/scripts/script.js` (`abs_path` will appear once for each frame in the stack trace - match this up with the file(s) that are not deminified.). A link to the JSON view can be found at the top of the issue page next to the date the event occurred. The uploaded artifact names must match these values. If you have **dynamic values in your path** (for example, `https://www.site.com/{some_value}/scripts/script.js`), you may want to use the `rewriteFrames` integration to change your `abs_path` values. @@ -203,7 +203,7 @@ Often users hit this limit because they are transmitting source files at an inte The Sentry API currently only works with source maps and source files that are uploaded as plain text (UTF-8 encoded). If the files are uploaded in a compressed format (for example, gzip), they will be not be interpreted correctly. -This sometimes occurs with build scripts and plugins that produce pre-compressed minified files. For example, Webpack’s [compression plugin](https://github.com/webpack/compression-webpack-plugin). You will need to disable such plugins and perform the compression _after_ the generated source maps/source files have been uploaded to Sentry. +This sometimes occurs with build scripts and plugins that produce pre-compressed minified files. For example, Webpack’s [compression plugin](https://github.com/webpack/compression-webpack-plugin). You’ll need to disable such plugins and perform the compression _after_ the generated source maps/source files have been uploaded to Sentry. ## Verify workers are sharing the same volume as web (if running self-hosted Sentry via Docker) From 976b3cade67f82315bb603fbaf65a18784bc0f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Wed, 25 May 2022 17:11:47 +0200 Subject: [PATCH 3/4] Apply suggestions from code review --- .../javascript/common/sourcemaps/troubleshooting_js.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx b/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx index b55e6575ab8a2..45b02af4d9800 100644 --- a/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx +++ b/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx @@ -67,7 +67,7 @@ If your `sourceMappingURL` comment is similar to: //# sourceMappingURL=script.min.js.map ``` -An example `sentry-cli` command to upload these files correctly would look like this (assuming you are in the `/scripts` directory, running your web server from one directory higher, which is why we are using the `--url-prefix` option): +An example `sentry-cli` command to upload these files correctly would look like this (assuming you’re in the `/scripts` directory, running your web server from one directory higher, which is why we’re using the `--url-prefix` option): ```shell sentry-cli releases files VERSION upload-sourcemaps . --url-prefix '~/scripts' @@ -167,7 +167,7 @@ First, install `source-map` globally as an npm module: npm install -g source-map ``` -Then, write a script that reads your source map file and tests a mapping. Here is an example: +Then, write a script that reads your source map file and tests a mapping. Here’s an example: ```javascript var fs = require("fs"), From f0ad639240c240f469e5a90588c63f055df6dcf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Wed, 25 May 2022 17:12:56 +0200 Subject: [PATCH 4/4] Apply suggestions from code review --- .../javascript/common/sourcemaps/troubleshooting_js.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx b/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx index 45b02af4d9800..6c7d27707e576 100644 --- a/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx +++ b/src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx @@ -6,7 +6,7 @@ description: "Troubleshooting for source maps." sidebar_order: 8 --- -Source maps can sometimes be tricky to get going. If you're having trouble, you can try using our verification tool inside `sentry-cli`, or go through the steps listed below yourself. Please keep in mind, that the `sentry-cli` is a work-in-progress, and we are actively working to improve it. +Source maps can sometimes be tricky to get going. If you’re having trouble, you can try using our verification tool inside `sentry-cli`, or go through the steps listed below yourself. Please keep in mind, that the `sentry-cli` is a work-in-progress, and we’re actively working to improve it. To use the automated verification process, [install and configure](/product/cli/) `sentry-cli`. Once completed, use the `sourcemaps explain` command, by calling it with the event ID that can be found at the top of the **Issue Details** page in [sentry.io](https://sentry.io). For example, "Event fdfd1337e3964cd6a4d11f35357a4c43 | JSON (42.0 KiB)". @@ -15,7 +15,7 @@ sentry-cli sourcemaps explain fdfd1337e3964cd6a4d11f35357a4c43 ``` This should provide you with some useful hints about what exactly went wrong with the source maps setup process. -If it doesn't, let us know so we can make it better. +If it doesn’t, let us know so we can make it better.