Fundebug WeChat applet BUG monitoring service supports Source Map

Fundebug WeChat applet BUG monitoring service supports Source Map

Summary: Automatically restore the real error location and quickly fix the BUG.

Source Map function

The Source Map function of the WeChat applet is currently only supported in iOS 6.7.2 and above.

When the WeChat applet is packaged, all js codes will be packaged into one file, thereby reducing the size and speeding up the access speed.

However, it is difficult to debug errors in compressed code because the error location is like this:

  • File: app-service.js
  • Line number: 13788
  • Column number: 7974

At this time, the wrong location information ( file, line number and column number ) loses value, because it is difficult for developers to know the corresponding source code location.

Fundebug's WeChat applet BUG monitoring supports restoring the error location through Source Map:

  • File: utils/util.js
  • Line number: 573
  • Column number: 8

In this way, developers can quickly locate the source code of the error.

In the Fundebug console, just click the Source Map button to switch the stack before and after compression:

If you want to use the Source Map function, users need to:

Download the Source Map file

  • Log in to the WeChat public platform
  • Switch to the "Development" page on the left
  • Click on the link "Download the online version of the Source Map file"

Upload Source Map file

Decompress the downloaded Source Map file, and just upload the **__APP__/app-service.map.map** file in the decompressed file.

Upload steps

  • Enter Fundebug "Control Panel"
  • Select "Project Settings"
  • Click "Source Map"
  • Select the Source Map file that needs to be uploaded (supports uploading multiple Source Map files)
  • Click "Upload"

You can configure the application version when uploading the Source Map:

The following picture shows the source map files of different versions that have been uploaded:

If you want to distinguish the Source Map files of different versions of WeChat Mini Programs, you need to configure the corresponding appversion property when accessing the Fundebug plug-in, which is consistent with the version set when uploading the Source Map:

fundebug.init({
    appVersion: "3.2.5"
});
 

The Source Map function of Fundebug WeChat Mini Game BUG monitoring service will also be launched as soon as possible, so stay tuned.

Finally, I would like to thank the friends from the Youth League for their assistance~

reference

About Fundebug

Fundebug focuses on real-time BUG monitoring of JavaScript, WeChat Mini Programs, WeChat Mini Games, Alipay Mini Programs, React Native, Node.js and Java online applications. Since the official launch of Double 11.in 2016, Fundebug has handled a total of 2 billion+ error incidents. Paying customers include Sunshine Insurance, Walnut Programming, Litchi FM, Master 1 to 1, Weimai, Youth League and many other brand companies. Everyone is welcome to try it for free !

Copyright Notice

When reprinting, please indicate the author Fundebug and the address of this article: blog.fundebug.com/2019/08/26/