# SourceMap Matching Debugging
To make it easier for developers to use sourceMap files to locate code problems, add a debugger plug-in to optimize sourceMap matching debugging.
# Operating environment
- Download and install the developer tools
1.03.2012152or above, and download the download for .
# Download process
Open WeChat Developer Tools, select "Settings - General Settings - Extensions - Debugger Plugins" in the menu bar, go to the plugin download page, add sourcemap matching debugging plugin.Once added, you can use the plug-in in the debugger.
# Use Procedure
- Download the sourceMap file (you can upload it to the We Analytics Platform or Developer Tools pop-up download)
- Find the subcontract corresponding to the error and select the map file of the subcontract
- Fill in the target line number and click the "Match button" to get a match and automatically locate the source code. (The developer tool automatically locates the code's corresponding location according to the source line number.) To ensure accurate positioning, the developer needs to ensure that the code version matches the sourceMap file.)
It shows as follows:

# Directory and file explaination of sourcemap
- __APP__is the main package,__FULL__is a block package (only used in the low version WeChat that does not support subpackages), and other directories are subpackages.
- Each subcontract has an app-service.js.map file.
- If you use the on-demand injection feature (lazyCodeLoading is configured in apagejson), then there will be an appservice.apagejs.map under each subpackage (JS for non-pages under the subpackage), and a xxx.js.map for all pages.
# How to troubleshoot Weixin Mini Program sourcemap file failure
Please refer to the document Weixin Mini Program sourcemap file failure
# Q&A
# Q: Why is it all null?
A: Each Weixin Mini Program version should have a sourcemap file.The sourcemap downloaded from our analysis platform is the latest Mini Program version on the corresponding line. But the Operations Center's error reports were a collection of multiple Mini Program versions. Take the old Mini Program version of the error message, and the latest version of the sourcemap, is not matched. Developer tools and CI upload, will prompt download the corresponding version of the sourcemap information, you can self-save.
If the version is the same, you can refer to the above Weixin Mini Program sourcemap file failure reason troubleshooting document first self-troubleshooting.
# Q: How do you know if there is a version?
A: The downloaded sourcemap has a wx field indicating the Weixin Mini Program version number of the sourcemap file.
