After the applet is officially released, a white screen opens (solved)

Problem: The applet is online, but when the mobile phone enters the applet, it is a blank page with nothing. It can be displayed normally when debugging on the real machine, there are no bugs in the running code, and the audit is also passed normally. I don’t know where the mistake is.

After querying, guess the problem is that the code is not standardized

WeChat officially provides a way to find bugs: wx.setEnableDebug

onLoad() {

	// 打开调试
	wx.setEnableDebug({
		enableDebug: true
	})

}

An error will be reported when the development tool is running, don’t worry about it, use the real machine to debug

In the lower right corner of the project, there is a vConsole label, click to view bugs;

 

Through vConsole, the reason for the white screen I found was "getElementsByTagName". The word global search was introduced in the js code of the iconfont I introduced. Delete iconfont.js (the deletion of this js will not affect the display of iconfont) and the white screen problem of the official version of the applet is solved.

How to close vConsole:

Add this code on the index page, and run it once on the real machine. 

onLoad() {
			
	// 关闭调试
	wx.setEnableDebug({
		enableDebug: false
	})

}

Guess you like

Origin blog.csdn.net/fbqgdxw/article/details/123269979