Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Typescript Type generation not working using proto-loader-gen-types

オープン
#3,077 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
grpc, typescript
領域
api

調査の方向性

proto のディレクトリ構成と記載されている Node およびパッケージのバージョンを使用して、Make target から報告されたコマンドを再現します。ワイルドカード引数が proto-loader-gen-types にどのように渡されるかを調査し、サポートされているパターンが、個別の user/v1/user.proto 入力と同じ型を ENOENT エラーなしで生成することを確認します。

索引モデルが issue の本文から書いたものです。

説明

feature request

Problem description

I can not generate typescript types.

Dependencies

"@grpc/grpc-js": "^1.14.4",
"@grpc/proto-loader": "^0.8.1",

Proto files are located in the project root directory inside proto in the following structure:

proto/common/v1/common.proto
proto/user/v1/user.proto
proto/tag/v1/tag.proto

When I run the command by providing individual proto file through make command:

❯ @npx proto-loader-gen-types --longs=String --enums=String--defaults --oneofs --grpcLib=@grpc/grpc-js -I=./proto/ -O=src/lib/server/grpc/types/ user/v1/user.proto

It works and generates the necessary types in the desired directory.

However when I run this:

❯ @npx proto-loader-gen-types --longs=String --enums=String--defaults --oneofs --grpcLib=@grpc/grpc-js -I=./proto/ -O=src/lib/server/grpc/types/ **/**/*.proto

It does not work.

It does not work with */*/*.proto , *.proto , */*.proto .

I get the error when I try with various approaches of using *:

(node:9591) Warning: */*.proto not found in any of the include paths proto/
(Use `node --trace-warnings ...` to show where the warning was created)
[Error: ENOENT: no such file or directory, open '*/*.proto'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '*/*.proto'
}
make: *** [testss] Error 1

I also ran :

	@npx proto-loader-gen-types --longs=String --enums=String--defaults --oneofs --grpcLib=@grpc/grpc-js -I=./proto/ -O=src/lib/server/grpc/types/ user/v1/*.proto

It doesn't work either. When I remove * and give the actual filename, it works however.

My assumption is that * is not being expanded at all.

Environment

OS name, version and architecture: MacOS Tahoe 26.6.2
Node version: v24.12.0
Npx Version: v11.6.2

主要言語
TypeScript
スター
4.8k
フォーク
716
平均マージ
1日 18時間
マージ済み PR(30日)
17

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

grpc/grpc-node のほかの issue

grpc/grpc-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。