2***@qq.com
2***@qq.com
  • 发布:2023-11-16 11:06
  • 更新:2023-11-17 20:21
  • 阅读:1656

【真机调试】报错 Uncaught TypeError: Cannot read property 'sendBeacon' of undefined

分类:HBuilderX

真机调试报错
reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Uncaught TypeError: Cannot read property 'sendBeacon' of undefined
at (app-service.js:18144:227479)
at (app-service.js:18144:286266)
at (app-service.js:18144:286358)
at (app-service.js:18144:37)
at ./node_modules/vconsole/dist/vconsole.min.js (app-service.js:18144:43)
at webpack_require (app-service.js:31:42)
at eval (<anonymous>:9:66)
at ./src/main.js (app-service.js:10064:1)
at
webpack_require
(app-service.js:31:42)
at __webpack_exec__ (app-service.js:18913:61)

可是代码里没有sendBeacon 这是为什么,求助!!

2023-11-16 11:06 负责人:无 分享
已邀请:
kaka8868

kaka8868

vconsole 引起的,node_modules里面搜不到,改成这样就行了
// #ifdef H5
const vconsole = require('vconsole');
new vconsole();
// #endif

  • Miaoaa

    也就是说uniapp只有h5端能正常使用vconsole吗,小程序和app端没法用

    2024-03-14 13:45

要回复问题请先登录注册