9***@qq.com
9***@qq.com
  • 发布:2019-06-24 12:12
  • 更新:2020-12-04 14:44
  • 阅读:3171

【报Bug】进入多层内页后,监听返回按钮报错appServiceSDKScriptError

分类:uni-app

详细问题描述

进入多层内页后,监听返回按钮报错appServiceSDKScriptError
[内容]

重现步骤

有4个页面,index/index2/index3/index4
从index跳转到index4
在index4中监听返回 跳到index2:
onBackPress:function(){
uni.switchTab({
url:'../index2/index2'
})
}
控制台会报错:
12:08:40.535 appServiceSDKScriptError
12:08:40.555 d.close is not a function. (In 'd.close()', 'd.close' is undefined); at uni.navigateBack
12:08:40.575 (global function):7:69334
12:08:40.595 bn@(global function):7:33734
12:08:40.615 e@(global function):7:69313
12:08:40.635 Jn@(global function):7:81569
12:08:40.655 (global function):8:844
12:08:40.675 invoke@(global function):8:889
12:08:40.695 invoke@(global function):8:104437
12:08:40.715 X@(global function):8:162031
12:08:40.735 (global function):8:169484
12:08:40.755 Wc@(global function):8:321365
12:08:40.775 (global function):8:209876
12:08:40.795 (global function):8:417742
12:08:40.815 (global function):8:417784
12:08:40.835 (global function):8:173417
12:08:40.855 j@(global function):7:5976
12:08:40.875 weex service:3:101648
12:08:40.895 onCallback@weex service:3:104115
12:08:40.915 weex service:3:16298
12:08:40.935 callbackFromNative@weex service:3:15894
12:08:40.955 eval code
12:08:40.975 eval@[native code]
12:08:40.995 weex service:3:14990
12:08:41.015 consume@(weex framework):1:20313
12:08:41.035 map@[native code]
12:08:41.055 (weex framework):1:178111

IDE运行环境说明

HBuilderX

[IDE版本号] 2.0.1.20190614

[windows版本号] win7

[mac版本号]

uni-app运行环境说明

[运行端是h5或app或某个小程序?]app

[运行端版本号]

[项目是cli创建的还是HBuilderX创建的?如果是cli创建的,请更新到最新版cli再试]

[编译模式是老模板模式还是新的自定义组件模式?]

App运行环境说明

[Android版本号] MIUI 10.3 android 9

[iOS版本号]

[手机型号]

[模拟器型号]

附件

[IDE问题请提供HBuilderX运行日志。菜单帮助-查看运行日志,点右键打开文件所在目录,将log文件压缩成zip包上传]

[App问题请提供可重现问题的代码片段,你补充的细一点,问题就解决的快一点]

[App安装包或H5地址]

[可重现代码片段]

联系方式

[QQ] 910297279

2019-06-24 12:12 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com - 程序猿

大牛文章https://ask.dcloud.net.cn/article/35120(uni-app自定义返回逻辑教程),可参考

1***@qq.com

1***@qq.com

可以使用onBackPress事件监听,里面一定要返回true;
具体使用可以看下面给公众号,搜索uni-app 监听返回按钮

DCloud_UNI_HT

DCloud_UNI_HT

使用最新的 HBuilderX 版本 ,自定义组件模式,没有发现问题。

  • 9***@qq.com (作者)

    https://i.loli.net/2019/06/24/5d107c1b95b5e28679.gif 我录了个视频,麻烦您看下

    2019-06-24 15:31

  • DCloud_UNI_HT

    回复 9***@qq.com: 是否是自定义组件模式?

    2019-06-24 16:57

  • 9***@qq.com (作者)

    回复 DCloud_UNI_HT: 是的 ,编译器版本:2.0.1,当前项目编译模式:自定义组件模式。

    2019-06-24 18:57

暗眼小子

暗眼小子 - 前端

同样的问题
13:53:11.551 appServiceSDKScriptError
13:53:11.570 appServiceSDKScriptError
13:53:11.590 JSON Parse error: Unexpected EOF;stringToAnyType
13:53:11.612 parse@[native code]
13:53:11.631 (global function):8:164414
13:53:11.650 (global function):8:163707
13:53:11.670 beforeAll@(global function):8:360453
...

cydida

cydida

同问 自定义编译模式 APP

无名小盗

无名小盗 - 小小

相同的问题再次出现,这个问题应该很容易就发现了

17:34:04.848 appServiceSDKScriptError
17:34:04.879 d.close is not a function. (In 'd.close()', 'd.close' is undefined); at uni.navigateBack
17:34:04.909 (global function):7:69334
17:34:04.930 bn@(global function):7:33734
17:34:04.951 e@(global function):7:69313
17:34:04.972 Jn@(global function):7:81569
17:34:04.997 (global function):8:844
17:34:05.024 invoke@(global function):8:889
17:34:05.045 invoke@(global function):8:104437
17:34:05.066 X@(global function):8:162031
17:34:05.087 (global function):8:169484
17:34:05.109 Wc@(global function):8:321365
17:34:05.134 (global function):8:209876
17:34:05.155 (global function):8:417742
17:34:05.176 (global function):8:417784
17:34:05.201 (global function):8:173417
17:34:05.227 j@(global function):7:5976
17:34:05.249 weex service:3:101648
17:34:05.274 onCallback@weex service:3:104115
17:34:05.300 weex service:3:16298
17:34:05.321 callbackFromNative@weex service:3:15894
17:34:05.345 eval code
17:34:05.370 eval@[native code]
17:34:05.395 weex service:3:14990
17:34:05.418 consume@(weex framework):1:20313
17:34:05.443 map@[native code]
17:34:05.464 (weex framework):1:178111

1***@qq.com

1***@qq.com - 90后的It女

同样的问题,以前用都灭报错

Viccy

Viccy

同样的问题
09:55:37.014 appServiceSDKScriptError
09:55:37.035 d.close is not a function. (In 'd.close()', 'd.close' is undefined); at uni.navigateBack
09:55:37.076 hn
09:55:37.097 e
09:55:37.118 qn
09:55:37.161 invoke
09:55:37.181 invoke
09:55:37.205 X
09:55:37.246 Wc
09:55:37.351 j
09:55:37.392 onCallback
09:55:37.434 callbackFromNative
09:55:37.455 eval code
09:55:37.476 eval@[native code]
09:55:37.518 consume
09:55:37.539 map@[native code]

g***@126.com

g***@126.com

同样的问题

14:17:07.322 appServiceSDKScriptError
14:17:07.342 undefined is not an object (evaluating 't.split'); at uni.switchTab
14:17:07.360 y
14:17:07.399 forEach@[native code]
14:17:07.420 fn
14:17:07.440 invokeHandler
14:17:07.480 invoke
14:17:07.500 invoke
14:17:07.522 X
14:17:07.562 Uc
14:17:07.682 initializePromise@[native code]
14:17:07.702 Promise@[native code]
14:17:07.722 promiseApi
14:17:07.783 consume
14:17:07.803 map@[native code]

该问题目前已经被锁定, 无法添加新回复