datadog-cli
that allows users to upload sourcemap
files to the Flashduty server. Through sourcemaps
, frontend developers can track and debug errors more efficiently. Users can view uploaded sourcemap
files in the "Application Management" - "Source Management" menu, and generate scripts for local execution through the upload panel. This document will provide detailed information about the purpose of sourcemaps
, methods for generating and uploading them, management approaches, and how to use sourcemaps
in the error tracking module to precisely locate issues.SourceMap
files solve this problem:SourceMaps
record the mapping relationship between compressed code and original code, allowing developers to view uncompressed source code during debugging.SourceMaps
, you can directly locate specific positions in the original source code when tracking errors, not just in the compressed files.SourceMaps
. Here's an example configuration using Webpack:SourceMap
generation in webpack.config.js
:
dist
directory will contain bundle.js
and its corresponding bundle.js.map
file.sourcemaps
command for uploading sourcemap
files to the Flashduty server. Here are the specific steps:flashcat-cli
via npm:
test2
).my-service
).1.0.0
)./assets
).
sourcemap
files are located in the specified path (such as the dist
directory). Flashduty CLI will upload the sourcemap
files to the server.
minified-path-prefix
matches the actual deployed path of your compressed files.sourcemap
files in Application Management - Source Management.sourcemap
files are managed through the Application Management - Source Management menu:sourcemap
files, including file paths, service names, version numbers, sizes, and upload times.service
and release-version
parameters, you can manage sourcemaps
for different versions of your application, facilitating parallel debugging across multiple versions.API Key
, only authorized users can upload or manage sourcemaps
.sourcemap
functionality, supporting direct viewing of original source code in the error tracking module for precise issue location. Here's the workflow:
sourcemaps
, Flashduty automatically maps the error location in compressed code to the original source code./assets/index-5e0391ac.js
:Error: Something went wrong
at Object.<anonymous> (/assets/index-5e0391ac.js:1:123)
sourcemap
, mapped to original source code src/components/App.js
:Error: Something went wrong
at App.render (src/components/App.js:45:10)
Something went wrong
.src/components/App.js:45:10
).flashcat-cli sourcemaps upload
command into your CI/CD pipeline to ensure automatic upload of sourcemaps
with each release.
--release-version
parameter consistent with your application version number for easier tracking of specific sourcemap
versions.sourcemap
files before uploading resources to CDN to avoid including source code information in the production environment.sourcemaps
, proactively throw test errors to verify if the error tracking module can correctly map to source code.sourcemaps
were successfully uploaded and that the minified-path-prefix
matches the actual deployment path.service
and release-version
match the application version when the error occurred.sourcemap
files are only uploaded to the Flashduty server and not directly exposed on the public internet.sourcemap
files (e.g., through Nginx configuration).API Key
is valid.