Unable to use Google Well Known Types with @grpc/reflection and @grpc/proto-loader
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- node.js, typescript
調査の方向性
まず、google/protobuf/duration.proto、@grpc/proto-loader、ReflectionService、grpcurl を import する、示されている proto で失敗を再現します。ReflectionService が packageDefinition をどのように使用し、Google Well-Known Types をどのように処理するかを調べます。reflection が実行時に google.protobuf.Duration を解決できれば作業完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem description
When using @grpc/proto-loader to load a .proto file that imports Google Well-Known Types (for example, google/protobuf/struct.proto), the server reflection fails to recognize those types at runtime.
Although proto-loader correctly builds and adds the Google WKTs to the packageDefinition object, running grpcurl with service reflection enabled produces the following error:
cannot resolve type: "*.google.protobuf.Duration" not found
A similar issue has been discussed here: https://github.com/fullstorydev/grpcurl/issues/459
Reproduction Steps
Proto:
syntax = "proto3";
package multiply_function;
import "google/protobuf/duration.proto";
message Request {
int32 op1 = 1;
int32 op2 = 2;
}
message Response {
int32 prod = 1;
google.protobuf.Duration processing_time = 3; // How long the calculation took
}
service Multiply {
rpc multiply (Request) returns (Response);
}
// Load a .proto file that imports a Google well-known type
const packageDefinition = await load(protoFile);
// Create and register the ReflectionService
const reflectionService = new ReflectionService(packageDefinition);
reflectionService.addToServer(grpcServer);
Environment
Node.js: v22.14.0
Dependencies:
@grpc/grpc-js: 1.13.3
@grpc/proto-loader: 0.7.15
@grpc/reflection: 1.0.4
Additional context
I’ve also tried supplying complete file descriptors—including the Google WKTs, but the issue persists. Any help would be greatly appreciated!
- 主要言語
- TypeScript
- スター
- 4.8k
- フォーク
- 716
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 17
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
grpc/grpc-node のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
package: @grpc/grpc-js
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
grpc/grpc-node#2993 · コメント 3 件 · リアクション 4 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
grpc/grpc-node#3091 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
feature request
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
grpc/grpc-node#3077 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
grpc/grpc-node#3068 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
inu-appcenter/memorIN-frontend#106 ·
メンテナーはふだん 1 日以内に返信
-
kind/bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 7 日以内に返信
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
CSCfi/sd-search-ui#145 ·
メンテナーはふだん 1 日以内に返信
-
Add: Cbeebies pl SDオープンcheck:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信