来自 REACT 的 google-protobuf 错误:TypeError:c.toArray 不是函数

问题描述

知道这个错误吗?

TypeError: c.toArray 不是函数 Function.push../node_modules/google-protobuf/google-protobuf.js.jspb.Message.setWrapperField

用python实现的grpc服务器。 grpc-web 客户端正在响应中。

原始消息:

message DatasetPath {
google.protobuf.StringValue FolderPath = 1;
}

调用此javascript代码时出现错误

const datasetPath = new DatasetPath();
datasetPath.setFolderpath("/"); //Error TypeError: c.toArray is not a function

协议编译 =>

protoc datasets.proto -I=../protobufs --js_out=import_style=commonjs,binary:. --grpc-web_out=import_style=commonjs,mode=grpcwebtext:.

使用的版本: "google-protobuf": "^3.15.5","grpc-web": "^1.2.1",

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)