---
title: Mini Program Error Logging Platform
---

## Overview

The Mini Program Error Logging Platform is a specialized tool for collecting, analyzing, and managing JavaScript runtime exceptions in mini programs. It helps developers quickly locate and resolve online issues, improving mini program stability and user experience.

## Features

The error logging platform provides the following core functions:

- **Error Collection & Aggregation**: Automatically collect JavaScript exceptions during mini program runtime
- **SourceMap Restoration**: Support source code mapping for error stacks to facilitate problem location
- **Multi-dimensional Statistics**: Provide various views including error trends, content, and lists
- **Real-time Monitoring**: Provide error data queries and monitoring for the past 30 days

Guide:

1. Log in to [Tuya Developer Platform](https://platform.tuya.com/miniapp/)
2. Go to Mini Program Management page
3. Click "JS Exception" to enter the error logging platform

## 1. IDE SourceMap Upload

### 1.1 Upload Configuration

SourceMap files are important tools for debugging and error location. The upload process is as follows:

- Check "Upload SourceMap" option in IDE before publishing
- SourceMap files will be uploaded to private storage bucket
- Address information is stored in database by version dimension

### 1.2 Storage Strategy

To control storage costs, the SourceMap file storage strategy is as follows:

- **Storage Period**: 30 days
- **Storage Location**: Private cloud storage bucket
- **Version Association**: Each mini program version corresponds to an independent SourceMap file

<Image src="/images/guide/js-exception/sourcemap-upload-en.png" width="500px" />

## 2. Error Overview

### 2.1 APP Filter Control

Error logs can be filtered to the following APPs:

- Public version APP
- OEM Apps created by mini program developers
- OEM Apps authorized to mini program developers (enterprise internal space authorization)

### 2.2 Error Overview & Trends

**Line Chart Display**

- Error quantity trend changes
- Error rate statistical analysis
- Support time range filtering (up to 30 days)

<Image src="/images/guide/js-exception/error-change-show-en.png" width="1000px" />

## 3. Error Aggregation & Search

### 3.1 Error Aggregation

The system intelligently aggregates similar errors with the following features:

- **Aggregation Strategy**: Errors with the same error stack will be classified together
- **Sorting Method**: Sort by error count in descending order
- **Pagination Support**: Support paginated queries to improve viewing experience

### 3.2 Search Functions

**Stack Search**:

- Support fuzzy search of error stacks
- Quickly locate specific types of errors

**Account Query**:

- Support queries by C-end account dimension
- Need to select a fixed App for querying

## 4. Error Details

The error details page provides comprehensive error information:

**Stack Information**:

- Complete error stack trace
- Support SourceMap restoration for source code location
- Specific code location where the error occurred

**Basic Information**:

- APP information where the error occurred
- Version information where the error occurred
- Page path where the error occurred
- Time point when the error occurred

<Image src="/images/guide/js-exception/error-detail-en.png" width="800px" />

**SourceMap Restoration**

Click source code view to perform SourceMap restoration:

- Ensure that the version has uploaded SourceMap files
- System automatically restores error stack to source code location

```javascript
// Error stack before restoration (compressed code)
at n (main.js:1:2345)
at r (main.js:1:6789)

// Error stack after restoration (source code)
at handleUserAction (pages/index/index.js:45:12)
at onClick (components/button/button.js:23:8)
```

<Image src="/images/guide/js-exception/sourcemap-parse-en.png" width="800px" />

## 5. Best Practices

### 5.1 Error Monitoring Strategy

**Active Monitoring**:

- Regularly check error overview trends
- Pay attention to time points when errors surge
- Focus on error conditions after new version releases

**Version Comparison**:

- Compare error rates between different versions
- Identify new problems introduced by version upgrades
- Verify fix effectiveness

### 5.2 Problem Location Techniques

**Utilize SourceMap**:

- Ensure every version has uploaded SourceMap
- Use restoration function to quickly locate source code position
- Combine with code review tools for problem analysis

**Multi-dimensional Analysis**:

- Combine user feedback with error logs
- Analyze error device and system distribution
- Focus on common characteristics of high-frequency errors
