"NavigateTo" and "redirectTo" in WeChat applet about front-end development——"errMsg": "navigateTo:fail webview count limit exceed"

wx.navigateTo given wx.redirectTo

Foreword: In a recent school project on the development of WeChat applets, I found a small problem worth discussing and sharing. When I took over the project of another classmate who was in charge of front-end development, when I jumped to the page, I could still jump normally at first, but afterwards I couldn't jump, and an error occurred.

The error message is as follows:

"ErrMsg": "navigateTo: fail webview count limit exceed" I
Insert picture description here
believe that some friends have encountered such problems in actual development.
First of all, we can roughly understand the general meaning of this error message:
"Exceeded page limit"
So I went to find specific instructions on wx.navigateTo , and found that the problem lies here.
The wx.navigateTo and <navigator> components implement page jumps, which can only be up to five layers . When the page path is greater than five levels and exceeds the limit, an error will be reported.

Solution:
consider using wx.redirectTo. The execution behavior of wx.redirectTo is: close the current page, and then jump to the specified page. Therefore, such problems will not arise.
Therefore, replacing wx.navigateTo with wx.redirectTo can solve the above problems!

Welcome everyone to leave a message and discuss, I hope this article is helpful to you!

Guess you like

Origin blog.csdn.net/qq_43263320/article/details/109117329