700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > TypeError: Cannot read properties of undefined (reading ‘MethodInfo‘)

TypeError: Cannot read properties of undefined (reading ‘MethodInfo‘)

时间:2019-12-10 08:29:56

相关推荐

TypeError: Cannot read properties of undefined (reading ‘MethodInfo‘)

调用proto文件所生成的js文件来初始化客户端时报这个错

TypeError: Cannot read properties of undefined (reading 'MethodInfo')

出现这个问题的原因是

通过proto生程js文件所用的protoc-gen-grpc-web.exe版本与grpc-web版本不一致所导致的

解决方法:

1,下载最新版exe文件重新生成js文件

下载地址

2, 重新生成js文件 生成方法在上一篇文章

3, 项目中的package.json中"grpc-web": "^1.3.1",安装该版本,为了防止缓存等各方面原因影响,建议删除整个nodemodules包,然后重新npm install或者yarn

然后错误就解决了~

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。