You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have a proto file which uses google.protobuf.FieldOptions and it fails compailing that protobufjs cannot resolve this.
Pasted the error below: /node_modules/protobufjs/src/root.js:243 throw Error("unresolvable extensions: " + this.deferred.map(function(field) {
Any idea how to make protobufjs support this?
Thanks
The text was updated successfully, but these errors were encountered:
SachinHg
changed the title
Support for using proto file with imports
Error: unresolvable extensions: 'extend google.protobuf.FieldOptions' when running server.js
May 31, 2019
I had the same problem and needed the following workaround to make it work. When loading the proto file you need to specify include file with definition of FieldOptions. This works assuming that protobufjs is a dependency of your project and that your script is in top-level directory of your project.
const packageDefinition = protoLoader.loadSync(PROTO_PATH, {
keepCase: false,
longs: Number,
enums: String,
defaults: true,
oneofs: true,
// this is to load google/descriptor.proto, otherwise you would see error:
// unresolvable extensions: 'extend google.protobuf.FieldOptions' in .csi.v1
includeDirs: [__dirname + '/node_modules/protobufjs'],
});
Also it's not a defect in grpc-mock package as this error appears anytime loading a proto file with such definition.
Hi,
I have a proto file which uses
google.protobuf.FieldOptions
and it fails compailing thatprotobufjs
cannot resolve this.Pasted the error below:
/node_modules/protobufjs/src/root.js:243 throw Error("unresolvable extensions: " + this.deferred.map(function(field) {
Any idea how to make protobufjs support this?
Thanks
The text was updated successfully, but these errors were encountered: