Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common problems in WeChat Mini Programs's development and how to solve them?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what are the common problems in the development of WeChat Mini Programs and how to solve them". In the daily operation, I believe that many people have doubts about the common problems in WeChat Mini Programs's development and how to solve them. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "what are the common problems in WeChat Mini Programs's development and how to solve them?" Next, please follow the editor to study!

Related to cloud development

A problem of failed call to cloud function

[SCF] [login] call failed Error: errCode:-404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID, cloud function service error code-504002, error message Function not found: [login]; at cloud.callFunction api

This problem usually occurs for the following two reasons

1. The cloud function is not deployed or is not deployed successfully

2. You have created multiple cloud development environments without configuring the corresponding environment id

Let's talk about the solutions to these two problems.

1. The cloud function is not deployed or is not deployed successfully

Select the cloud function we want to deploy, and right-click, as shown in the red box above. If you can't upload one click, click a few more times until the prompt box below appears.

2. You have created multiple cloud development environments without configuring the corresponding environment id

If you create multiple cloud development environments, sometimes developer tools are so stupid that they don't know which cloud development environment to use. At this time, we have to specify a cloud development environment.

If you have multiple development environments, be sure to pay attention to the environment name, which must correspond to the environment id one by one.

Related to cloud database

A set or update data Times has the following error

Error: errCode:-502001 database request fail | errMsg: [FailedOperation.Insert] multiple write errors: [{write errors: [{E11000 duplicate key error collection: tnt-12p3936xo.x-j-l index: id dup key: {: "xjl"}}]}, {}]

Detailed errors are shown in the following figure:

Cause of error

The main reason for this error is that you did not create the data you modified. When we directly manipulate the cloud database, set the following permissions in the database.

This permission only allows you to read everyone's data, but if you modify it, you can only modify the data you create. What kind of data is created by yourself? As shown in the following picture.

So at this point, we probably know how to solve this problem.

Solution

1. Change _ openid to your own openid

2, with the help of cloud function.

Here, with the help of cloud functions, because you have no way to directly modify other people's data, but with the help of cloud functions, you can modify anyone's data.

At this point, the study on "what are the common problems in the development of WeChat Mini Programs and how to solve them" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report