uni-app vue3 版 微信小程序 报Bug

uni-app vue3 版 微信小程序 报Bug

开发环境 版本号 项目创建方式
Mac big sur 11.2.3 CLI

示例代码:

TypeError: (t.default || t).mixin is not a function  
    at pe (vendor.js? [sm]:1)  
    at Object.<anonymous> (vendor.js? [sm]:1)  
    at Object.b (vendor.js? [sm]:1)  
    at c (runtime.js? [sm]:3)  
    at Module.d7 (main.js? [sm]:1)  
    at c (runtime.js? [sm]:3)  
    at t (runtime.js? [sm]:3)  
    at Array.n [as push] (runtime.js? [sm]:3)  
    at main.js? [sm]:1  
    at require (VM54 WAService.js:2)

操作步骤:

  1. 创建空白vue3 项目
vue create -p dcloudio/uni-preset-vue#vue3 my-vue3-project
  1. 点击 manifest.json 选 uni统计
  2. 发行 到微信小程序

预期结果:

发行 到微信小程序

实际结果:

报错 无法运行

bug描述:

添加uni统计

开发模式,运行到小程序 会提示…但还可以运行

无效的 app.json ["uniStatistics"]

发行到小程序 会报错 无法运行


更多关于uni-app vue3 版 微信小程序 报Bug的实战教程也可以访问 https://www.itying.com/category-93-b0.html

1 回复

更多关于uni-app vue3 版 微信小程序 报Bug的实战教程也可以访问 https://www.itying.com/category-93-b0.html


这个问题是由于在uni-app的Vue3版本中,uni统计功能尚未完全适配微信小程序平台导致的。

从错误信息来看,主要存在两个问题:

  1. 开发模式下出现的无效的 app.json ["uniStatistics"]警告,说明微信小程序平台目前不支持uni统计的配置项。

  2. 发行时出现的TypeError: (t.default || t).mixin is not a function错误,表明uni统计的Vue3版本存在兼容性问题,mixin语法在当前的Vue3版本中无法正常使用。

解决方案:

暂时移除uni统计功能。在manifest.json中取消勾选uni统计选项,或者直接在配置文件中删除相关配置:

{
  "uniStatistics": {
    "enable": false
  }
}
回到顶部