How do you import the timestamp type?

时间:2017-10-12 10:13:20

标签: javascript node.js protocol-buffers grpc

I am having problems to import the standard timestamp.proto in node.js.

// Some abc.proto file
import "google/protobuf/timestamp.proto";
...
...

When doing something like this:

var grpc = require('grpc');
var protoDescriptor = grpc.load('abc.proto');

I expect grpc to get the timestamp.js from the installation directory but this is not the case.

How do you import the timestamp type in node.js.

I have a local grpc install (npm)? I would prefer to avoid passing paths, etc. In fact, the grpc node.js package does not seem to be deploying the standard proto files.

1 个答案:

答案 0 :(得分:2)

这已在相应的回购中作为问题打开 https://github.com/grpc/grpc/issues/13010

目前这似乎是一个已知的限制。