组件中引用MQTT import * as mqtt from 'mqtt/dist/mqtt.js' ;
当编译到安卓APP时会报错:
reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Uncaught TypeError: Cannot read property 'language' of undefined
at node_modules/@jspm/core/nodelibs/browser/process.js (app-service.js:15460:27)
at init (app-service.js:15254:60)
at node_modules/esbuild-plugin-polyfill-node/polyfills/process.js (app-service.js:15639:9)
at __init (app-service.js:15254:60)
at node_modules/@jspm/core/nodelibs/browser/buffer.js (app-service.js:17471:9)
at init (app-service.js:15254:60)
at node_modules/esbuild-plugin-polyfill-node/polyfills/buffer.js (app-service.js:17490:9)
at init (app-service.js:15254:60)
at build/index.js (app-service.js:36444:9)
at require (app-service.js:15257:54)

含光
- 发布:2025-07-22 17:46
- 更新:2025-08-14 14:53
- 阅读:91


DCloud_UNI_OttoJi - 日常回复 uni-app/x 问题,如果艾特我没看到,请主动私信
Cannot read property 'language' of undefined
进去看一下这个参数应该是什么。mqtt 在插件市场有兼容插件,我看你的报错来自 node_modules 原始 npm 包可能不兼容应用和非浏览器环境