AgoraIO / Basic-Video-Broadcasting

Sample app to join/leave a channel, set the role as a host/audience, mute/unmute, switch between front/rear cameras, and set the video parameters.
MIT License
269 stars 287 forks source link

TypeError: Cannot read property 'name' of undefined #34

Closed wwb20030901 closed 4 years ago

wwb20030901 commented 4 years ago

web端直播报错 test

Matrixbirds commented 4 years ago

可以提供一下你的复现环境和复现步骤吗?

wwb20030901 commented 4 years ago

在编译和启动实例程序前,您需要首先获取一个可用的App ID:

在agora.io创建一个开发者账号

前往后台页面,点击左部导航栏的 项目 > 项目列表 菜单

复制后台的 App ID 并备注,稍后启动应用时会用到它

在项目页面生成临时 Access Token (24小时内有效)并备注,注意生成的Token只能适用于对应的频道名。

把文件 .env.example 重命名为 .env file. 在这个文件中,将<#YOUR APP ID#>替换为您自己的App ID。

REACT_APP_AGORA_APP_ID=<#YOUR Agora.io APP ID#> REACT_APP_AGORA_LOG=true

这些步骤我都是按照提示做的

只是后面的npm install我发现一直有报错, 我改用了cnpm install,cnpm是指向淘宝镜像的npm工具

安装成功后, 执行cnpm run dev 可以访问localhost:3000,看到登录页面 当进入直播页跳转的时候报错

OkarinLi commented 4 years ago

我也遇到同样的问题,请问解决了吗?

Matrixbirds commented 4 years ago

@wwb20030901 @OkarinLi 可能是因为这里没有传递token导致的。我这边加了一下可以参考 这里

victjam commented 4 years ago

I have the same problem, you find a solution?, I generate the token and run the app but the errors don't go away.