1***@163.com
1***@163.com
  • 发布:2024-10-06 18:41
  • 更新:2024-11-19 18:10
  • 阅读:117

【报Bug】导入mqttjs,发送给基座之后会提醒 Cannot read property 'language' of undefined

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win11

HBuilderX类型: 正式

HBuilderX版本号: 4.29

手机系统: Android

手机系统版本号: Android 14

手机厂商: 小米

手机机型: redmi k70 ultra alsc

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
<template>  
    <view class="content">  
        <image class="logo" src="/static/logo.png"></image>  
        <view class="text-area">  
            <text class="title">{{ title }}</text>  
        </view>  
    </view>  
</template>  

<script setup>  
import { ref } from 'vue';  
import mqtt from "mqtt";  
const title = ref('hello');  
</script>  

<style>  
.content {  
    display: flex;  
    flex-direction: column;  
    align-items: center;  
    justify-content: center;  
}  

.logo {  
    height: 200rpx;  
    width: 200rpx;  
    margin-top: 200rpx;  
    margin-left: auto;  
    margin-right: auto;  
    margin-bottom: 50rpx;  
}  

.text-area {  
    display: flex;  
    justify-content: center;  
}  

.title {  
    font-size: 36rpx;  
    color: #8f8f94;  
}  
</style>  

操作步骤:

只要发送道真机就会有这个错误

预期结果:

18:27:24.526 reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Uncaught TypeError: Cannot read property 'language' of undefined
at (app-service.js:167:90)
at (app-service.js:82:39)
at (app-service.js:195:5)
at (app-service.js:82:39)
at (app-service.js:1157:5)
at (app-service.js:82:39)
at (app-service.js:1169:5)
at (app-service.js:82:39)
at (app-service.js:11707:5)
at (app-service.js:83:33)

实际结果:

18:27:24.526 reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Uncaught TypeError: Cannot read property 'language' of undefined
at (app-service.js:167:90)
at (app-service.js:82:39)
at (app-service.js:195:5)
at (app-service.js:82:39)
at (app-service.js:1157:5)
at (app-service.js:82:39)
at (app-service.js:1169:5)
at (app-service.js:82:39)
at (app-service.js:11707:5)
at (app-service.js:83:33)

bug描述:

我新建项目尝试引入最新版本的mqttjs,在Android系统下,无论是默认基座,还是自定义基座都会出现相同的问题,只是单纯引入了mqttjs,没写其他代码

2024-10-06 18:41 负责人:无 分享
已邀请:
1***@163.com

1***@163.com

版本太高了,用4.3.8试试

要回复问题请先登录注册