uni-app H5 打包时选择托管到阿里云,访问报错 __uniConfig is not defined

uni-app H5 打包时选择托管到阿里云,访问报错 __uniConfig is not defined

操作步骤:

  • 我的代码100%可以复现,至于你们怎么复现我不清楚

预期结果:

  • 和运行时访问效果一致就可以

实际结果:

  • 报错

bug描述:

如图所示。 图6是可以正常运行正常访问的,打包并托管到unicloud后无论是用自定义域名访问还是默认域名访问都是报错

Uncaught ReferenceError: `_uniConfig` is not defined
at Ym (vendor.BJX7-PB.js:18:132071)
at zm (vendor.BJX7-PB.js:18:134612)
at Km (vendor.BJX7-PB.js:18:135500)
at vendor.BJX7-PB.js:18:135525
at vendor.BJX7-PB.js:18:53804
at sheep.7NvTu75U.js:1:32188

| 产品分类 | PC开发环境操作系统 | PC开发环境操作系统版本号 | HBuilderX类型 | HBuilderX版本号 | 浏览器平台 | 浏览器版本 | 项目创建方式 |
|----------|-------------------|------------------------|---------------|----------------|------------|------------|--------------|
| uniapp/H5 | Windows           | 11                     | 正式          | 4.83           | Chrome     | 版本 141.0.7390.108(正式版本) (64 位) | HBuilderX |

![Image](https://www.itying.com/uniimg.php?url=https://img-cdn-tc.dcloud.net.cn/uploads/questions/20251021/d70e34e78b60287c5cc3d6f679f920d8.png)
![Image](https://www.itying.com/uniimg.php?url=https://img-cdn-tc.dcloud.net.cn/uploads/questions/20251021/f2cb314644e6bdb4b4a5263e0606f634.png)
![Image](https://www.itying.com/uniimg.php?url=https://img-cdn-tc.dcloud.net.cn/uploads/questions/20251021/6c9cdcc6e00147a61a59724b4f671e39.png)
![Image](https://www.itying.com/uniimg.php?url=https://img-cdn-tc.dcloud.net.cn/uploads/questions/20251021/654bad05946a6142c6c68d01dcac172f.png)
![Image](https://www.itying.com/uniimg.php?url=https://img-cdn-tc.dcloud.net.cn/uploads/questions/20251021/0e8c23a7b9ca588c7d2221cc5b1131b2.png)
![Image](https://www.itying.com/uniimg.php?url=https://img-cdn-tc.dcloud.net.cn/uploads/questions/20251021/df3c5b4eb0fc3f4a2f72260262249c4b.png)

更多关于uni-app H5 打包时选择托管到阿里云,访问报错 __uniConfig is not defined的实战教程也可以访问 https://www.itying.com/category-93-b0.html

回到顶部