Uncaught (in promise) thirdScriptError {errMsg:hideLoading:fail:toast can't be found}
小程序真机调试报错:
[publib]:2 Uncaught (in promise) thirdScriptError {“errMsg”:“hideLoading:fail:toast can’t be found”} Object
原因:
wx.showLoading与wx.hideLoading,wx.showToast与wx.hideToast没有对应,一般在打开提示(wx.showLoading)后,就要关闭提示(wx.hideLoading)
之前不会这么严格,不会报错,版本更新后的就必须要两者对应了
解决办法:
在用到wx.showLoading和wx.showToast的时候,适当地方关闭就行
思路:
定义两个变量 isShowLoading = false ; isShowToast = false
① 调用 wx.hideLoading时候先判断 isShowloading,为true才能执行,否则不执行;接着执行showLoading 函数,执行结束将 isShowLoading 设为 true。
② 调用 wx.hideToast时候判断 isShowToast ,为 true就执行 ,否则不执行;接着执行showToast函数,执行结束将 isShowToast设为 true。
每次使用wx.hideLoading 和 wx.hideToast 都要做判断
var isShowLoading = false;
var isShowToast = false;Page({start: function() {//调用 wx.hideLoading 时候先判断 isShowloadingif (!isShowLoading) {wx.hideLoading();}wx.showLoading({title: '加载'})isShowLoading = true;// wx.showToast 时候判断 isShowloadingif (!isShowToast) {wx.hideToast();}wx.showToast({title: '提示',});isShowToast = true;}});
Uncaught (in promise) thirdScriptError {errMsg:hideLoading:fail:toast can't be found}相关推荐
- 关于微信小程序VM22:2 (in promise) MiniProgramError {“errMsg“:“hideLoading:fail:toast can‘t be found“
出现错误的原因如下 1.是微信小程序 2.把请求接口统一封装,开始请求接口时showLoading,请求接口后hideLoading 3.一个页面同时请求多个接口,由于请求是异步的,很有可能上一个开启 ...
- 微信真机调试时出现 (in promise) MiniProgramError {“errMsg“:“hideLoading:fail:toast can‘t be found“} Object
微信更新后 wx.showLoading 和 wx.showToast 同时只能显示一个 wx.showLoading 应与 wx.hideLoading 配对使用 解决方法 定义一个变量isShow ...
- 小程序 报错errMsg: “hideLoading:fail:toast can‘t be found“ ?
小程序体验版上/真机上报错:errMsg: "hideLoading:fail:toast can't be found" ?模拟器上却看不到, wx.showLoading 和 ...
- 微信小程序真机调试报错{“errMsg“:“hideLoading:fail:toast can‘t be found“}
真机调试时,遇到报错: (in promise) MiniProgramError {"errMsg":"hideLoading:fail:toast can't be ...
- 小程序报错errMsg:hideLoading:fail:toast can't be found和hideToast:fail:toast can't be found?解决方案
小程序报错 errMsg":"hideLoading:fail:toast can't be found"和hideToast:fail:toast can't be f ...
- 微信小程序体验版ios白屏 安卓报错 {“errMsg“:“hideLoading:fail:toast can‘t be found“}
在编辑器中显示正常 然后使用ios真机调试页面数据都不显示 后来各种查阅 微信官网提供的调试工具 wx.setEnableDebug 使用安卓机测试出报错{"errMsg":&qu ...
- 小程序真机调试报错: errMsg“:“hideLoading:fail:toast can‘t be found“?
小程序真机调试报错: errMsg":"hideLoading:fail:toast can't be found"? 上线小程序后报错,导致toast直接不显示或者一闪 ...
- 微信小程序报错 {“errMsg“: “hideLoading:fail toast can‘t be found“}
{"errMsg": "hideLoading:fail toast can't be found"} 原因 wx.showToast() 和 wx.sho ...
- 微信小程序报错{errMsg:hideLoading:fail:toast can't be found}
最近在调试微信小程序时,发现有报错问题,虽然没影响使用,但是看着不舒服啊,还是着手解决吧,先看一下报错 从论坛看了看说是最新版本的微信7.0.13测试版会出现,但是还得找找看看是不是这样 我们都知道w ...
最新文章
- 线段树分裂与合并 ----- P2824 [HEOI2016/TJOI2016]排序 [线段树分裂合并 OR 01序列排序+二分线段树]
- 程序分析的一些概念总结
- 通过命令行启动 Microsoft File Transfer Manager
- ML重要概念:梯度(Gradient)与梯度下降法(Gradient Descent)
- matlab记录路径,matlab对文件目录路径的操作
- ensp安装对电脑配置要求高吗_直线导轨有哪些安装方法?为什么直线导轨安装精度要求高?...
- Magento教程 12:Magento快速上传大量商品的方法
- 5亿人都在用的拼多多还在亏损,百亿补贴仍将继续
- java spring多数据源配置文件_深入理解spring多数据源配置
- 怎么制作app?0编程外卖平台系统开发
- video safari不支持吗_您支持吗? 公园遛狗纳入 “不文明行为黑名单”
- ios手机游戏 带你体验拉斯维加斯的疯狂
- Docker_制作docker镜像
- win7计算机系统还原,如何使用Win7系统自带还原修复电脑
- 史上最详细的UE4安装教程(没有之一,就是史上最详细,不服气你来打我呀)
- 恢复U盘分区:windows自带工具diskpart
- 2016年中国安防系统集成商发展状况如何?
- cv.bitwise_and用法
- 微软高级招聘经理谈IT人才招聘
- a href=http://www.pianopro.cn通州钢琴培训/a