{"componentChunkName":"component---src-templates-platform-tsx","path":"/platforms/javascript/guides/angular/sourcemaps/uploading/","result":{"data":{"file":{"id":"84f01ae2-f42a-54c0-9423-56ec8a15dd83","relativePath":"javascript/common/sourcemaps/uploading.mdx","sourceInstanceName":"platforms","childMarkdownRemark":null,"childMdx":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Uploading Source Maps\"\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar Note = makeShortcode(\"Note\");\nvar CodeTabs = makeShortcode(\"CodeTabs\");\nvar CodeBlock = makeShortcode(\"CodeBlock\");\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"We recommend uploading source maps as part of your build process, but you can also \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"../hosting-publicly/\"\n  }), \"serve them publicly alongside your source files\"), \".\"), mdx(Note, {\n    mdxType: \"Note\"\n  }, mdx(\"markdown\", null, mdx(\"p\", null, \"The recommended way to upload source maps is using \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/cli/\"\n  }), \"sentry-cli\"), \". If you have used \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://github.com/getsentry/sentry-wizard\"\n  }), mdx(\"em\", {\n    parentName: \"a\"\n  }, \"Sentry Wizard\")), \" to set up your project, it has already created all necessary configuration to upload source maps. Otherwise, follow the \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/cli/configuration/\"\n  }), \"CLI configuration docs\"), \" to set up your project.\"))), mdx(\"p\", null, \"You need to set up your build system to create a release and attach the various source files. For Sentry to de-minify your stack traces, you must provide both the minified files (for example, \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"app.min.js\"), \") and the corresponding source maps. If the source map files do not contain your original source code (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sourcesContent\"), \"), you must also provide the original source files. (Alternatively, sentry-cli will automatically embed the sources (if missing) into your source maps if you pass the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"--rewrite\"), \" flag.\"), mdx(\"p\", null, \"Sentry uses \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/releases/\"\n  }), mdx(\"strong\", {\n    parentName: \"a\"\n  }, \"Releases\")), \" to match the correct source maps to your events. To create a new release, run the following command (for example, during publishing):\"), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"sentry-cli releases new \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"<\"), \"release_name\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \">\"))))))), mdx(Note, {\n    mdxType: \"Note\"\n  }, mdx(\"markdown\", null, mdx(\"p\", null, \"The release name must be \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"unique within your organization\"), \" and match the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"release\"), \" option in your SDK initialization code. Then, use the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"upload-sourcemaps\"), \" command to scan a folder for source maps, process them and upload them to Sentry.\"))), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"sentry-cli releases files \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"<\"), \"release_name\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \">\"), \" upload-sourcemaps /path/to/files\")))))), mdx(Note, {\n    mdxType: \"Note\"\n  }, mdx(\"markdown\", null, mdx(\"p\", null, \"You can find the artifacts uploaded to Sentry by navigating to \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"[Project]\", \" \\xBB Project Settings \\xBB Source Maps\"), \".\"))), mdx(\"p\", null, \"This command will upload all files ending in \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \".js\"), \" and \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \".map\"), \" to the specified release. If you wish to change these extensions \\u2013 for example, to upload typescript sources \\u2013 use the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"--ext\"), \" option:\"), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"sentry-cli releases files \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"<\"), \"release_name\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \">\"), \" upload-sourcemaps --ext ts --ext map /path/to/files\")))))), mdx(\"p\", null, \"Until now, the release is in a draft state (\\u201C\", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"unreleased\"), \"\\u201D). Once all source maps have been uploaded, and your app has been published successfully, finalize the release with the following command:\"), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"sentry-cli releases finalize \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"<\"), \"release_name\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \">\"))))))), mdx(\"p\", null, \"For convenience, you can alternatively pass the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"--finalize\"), \" flag to the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"new\"), \" command which will immediately finalize the release.\"), mdx(\"p\", null, \"You don't \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"have\"), \" to upload the source files (referenced by source maps), but without them, the grouping algorithm will not be as strong, and the UI will not show any contextual source.\"), mdx(\"p\", null, \"For more information, see our \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/api/releases/\"\n  }), \"Releases API documentation\"), \".\"), mdx(\"p\", null, \"It\\u2019s not uncommon for a web application to be accessible at multiple origins. See our documentation on \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"../multiple-origins/\"\n  }), \"multiple origins\"), \" on how to handle this.\"));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{},"internal":{"type":"Mdx"}}}},"pageContext":{"excerpt":"We recommend uploading source maps as part of your build process, but you can also  serve them publicly alongside your source files . The recommended way to upload source maps is using  sentry-cli . If you have used  Sentry Wizard  to set up your project, it has already created all necessary configuration to upload source maps. Otherwise, follow the  CLI configuration docs  to set up your project. You need to set up your build system to create a release and attach the various source files. For Sentry to de-minify your stack traces, you must provide both the minified files (for example,  app.min.js ) and the corresponding source maps. If the source map files do not contain your original source code ( sourcesContent ), you must also provide the original source files. (Alternatively, sentry-cli will automatically embed the sources (if missing) into your source maps if you pass the  --rewrite  flag. Sentry uses  Releases  to match the correct source maps to your events. To create a new release, run the following command (for example, during publishing): The release name must be  unique within your organization  and match the  release  option in your SDK initialization code. Then, use the  upload-sourcemaps  command to scan a folder for source maps, process them and upload them to Sentry. You can find the artifacts uploaded to Sentry by navigating to  Project  » Project Settings » Source Maps . This command will upload all files ending in  .js  and  .map  to the specified release. If you wish to change these extensions – for example, to upload typescript sources – use the  --ext  option: Until now, the release is in a draft state (“ unreleased ”). Once all source maps have been uploaded, and your app has been published successfully, finalize the release with the following command: For convenience, you can alternatively pass the  --finalize  flag to the  new  command which will immediately finalize the release. You don't  have  to upload the source files (referenced by source maps), but without them, the grouping algorithm will not be as strong, and the UI will not show any contextual source. For more information, see our  Releases API documentation . It’s not uncommon for a web application to be accessible at multiple origins. See our documentation on  multiple origins  on how to handle this.","title":"Uploading Source Maps","platform":{"name":"javascript","title":"JavaScript"},"guide":{"name":"angular","title":"Angular"},"noindex":true,"notoc":true,"redirect_from":[],"id":"84f01ae2-f42a-54c0-9423-56ec8a15dd83"}},"staticQueryHashes":["1218203755","1222113826","1222113826","1766336459","2158593473","2404336828","2472290386","2764967025","3818502851","4015007367","4192517163","4264099332","518019976"]}