Moved from GitHub dgraph-js/80
Posted by lhr0909:
We have encountered an issue with the generated grpc files in the 2.0.1
npm lib where it is using features that only exist in google-protobuf@3.8.0+
.
when we were trying to run with the lower version it we get yelled at for the below error:
(node:86170) UnhandledPromiseRejectionWarning: TypeError: jspb.Message.getBooleanFieldWithDefault is not a function
at Function.proto.api.Operation.toObject (/Users/simon/Documents/git-repo/treelab-api/node_modules/dgraph-js/generated/api_pb.js:1424:27)
at proto.api.Operation.toObject (/Users/simon/Documents/git-repo/treelab-api/node_modules/dgraph-js/generated/api_pb.js:1406:30)
at Object.stringifyMessage (/Users/simon/Documents/git-repo/treelab-api/node_modules/dgraph-js/lib/util.js:52:31)
at DgraphClient.<anonymous> (/Users/simon/Documents/git-repo/treelab-api/node_modules/dgraph-js/lib/client.js:62:64)
at step (/Users/simon/Documents/git-repo/treelab-api/node_modules/dgraph-js/lib/client.js:32:23)
at Object.next (/Users/simon/Documents/git-repo/treelab-api/node_modules/dgraph-js/lib/client.js:13:53)
at /Users/simon/Documents/git-repo/treelab-api/node_modules/dgraph-js/lib/client.js:7:71
at new Promise (<anonymous>)
at __awaiter (/Users/simon/Documents/git-repo/treelab-api/node_modules/dgraph-js/lib/client.js:3:12)
at DgraphClient.alter (/Users/simon/Documents/git-repo/treelab-api/node_modules/dgraph-js/lib/client.js:56:16)
(node:86170) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:86170) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit **code.**
After installing google-protobuf@3.9.2
it fixes the issue.
Relevent Issue at google-protobuf
- google protobuf for JavaScript : type error jspb.Message.getFloatingPointFieldWithDefault · Issue #6057 · protocolbuffers/protobuf · GitHub