6***@qq.com
6***@qq.com
  • 发布:2020-04-11 17:42
  • 更新:2020-12-03 10:38
  • 阅读:1401

运行在app的nvue页面中引入腾讯im的web&小程序sdk后编译报错,vue页面就正常

分类:nvue

import TIM from '@/common/js_sdk/tim-js.js'

报错

reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Exception: Error: Module build failed (from ./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js):
17:29:25.672 Error: ENOENT: no such file or directory, open 'D:\xiangmu3\yjyh_app\pages\live\chat.vue'
17:29:25.692 eval code
17:29:25.713 eval@[native code]
17:29:25.733 weex createInstanceContext:6876:5
17:29:25.754 webpack_require@weex createInstanceContext:4894:35
17:29:25.795 eval code
17:29:25.816 eval@[native code]
17:29:25.836 weex createInstanceContext:6865:5
17:29:25.857
webpack_require
@weex createInstanceContext:4894:35
17:29:25.877 checkDeferredModules@weex createInstanceContext:4851:45
17:29:25.898 weex createInstanceContext:6855:61
17:29:25.918 require@weex createInstanceContext:4:665947
17:29:25.939 global code@weex createInstanceContext:6882:8
17:29:25.980 getTemplateInfo== template md5 872ba73da4664cfa6b330dd8965157e6 length 7783462 base64 md5 hyunPaRmTPprMw3YllFX5g== response header {"templateSourceBase64MD5":["hyunPaRmTPprMw3YllFX5g=="],"templateSourceMD5":["872ba73da4664cfa6b330dd8965157e6"]}

2020-04-11 17:42 负责人:无 分享
已邀请:
DCloud_heavensoft

DCloud_heavensoft

提供一个对比示例工程。最好能直接定位到nvue不支持那个js api,是否已经属于文档里声明的nvue不支持的部分

jyamiao

jyamiao

同楼主执行到
TIM.setLogLevel(0);

reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Uncaught SyntaxError: Unexpected end of input

跳过这一步执行到

let promise = TIM.login({
userID: userId,
userSig: this.dataRes.imUserSig
});


TypeError: _timJsSdk.default.login is not a function

jyamiao

jyamiao

19:05:17.810 TIM 19:05:17 GMT 0800 (CST).091:TIM.VERSION: 2.8.5
19:05:17.830 TIM 19:05:17 GMT 0800 (CST).092:TIM.create
19:05:17.853 TIM 19:05:17 GMT 0800 (CST).128:SinglyLinkedList init MAX_LENGTH=100
19:05:17.871 TIM 19:05:17 GMT 0800 (CST).130:SinglyLinkedList init MAX_LENGTH=100
19:05:17.893 TIM 19:05:17 GMT 0800 (CST).138:SDK instanceID:d1680f7101c9a16d25ebc8462e48f006 oversea:false inMiniApp:true, SDKAppID:1400447856, UserAgent:
19:05:17.913 TIM 19:05:17 GMT 0800 (CST).139:TIM.create ok

TIM的初始化写在了vue里面就没有问题 执行到nvue的方法就报错了

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