dcloudio / dcloudio/uni-app

hello uni-app 模版启动报错 Cannot read properties of undefined (reading 'length')

Open
#3,764 20 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
41.6k
Forks
3.7k
Avg merge
7h 6m
Merged PRs (30d)
6

Description

**问题描述**

hello uni-app 模版 web 端无法显示,控制台报错:

```
Uncaught TypeError: Cannot read properties of undefined (reading 'length')
```

**复现步骤**

分别有使用 命令行 创建 和 下载 HB 创建项目;

一、命令行

1. 命令行选择
![image](https://user-images.githubusercontent.com/20151912/182515066-b48d1082-a50d-40ff-b610-ff1b184937da.png)

2. yarn serve 控制台未报错
![image](https://user-images.githubusercontent.com/20151912/182515308-50f04f67-2d10-4b03-8167-c8bfede62d46.png)

二、HBuilder

1. HB 选择
![image](https://user-images.githubusercontent.com/20151912/182515163-06d9c1b8-a923-4317-b8d7-d1ac16a88c60.png)

2. HB 运行

![image](https://user-images.githubusercontent.com/20151912/182515419-18bb6804-c078-4ef8-988f-4782060a16e7.png)

**预期结果**

控制台不报错,界面展示 demo

**实际结果**

运行终端未报错,浏览器控制台报错,页面空白。

![image](https://user-images.githubusercontent.com/20151912/182515794-57cd2297-6a2c-4d0e-8974-49e00e5e9354.png)

**补充信息**

无法定位错误,`main.js` 里没有 `length` 变量

附:官网验证手机一直在 loading 过不了,所以来 GitHub 提 issue

![image](https://user-images.githubusercontent.com/20151912/182514616-866d6f16-a70e-4b86-b41b-0cc49e93a076.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.