Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#3,077 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
grpc, typescript
Ambito
api

Direzione di ricerca

Riproduci i comandi segnalati dal target Make utilizzando la struttura delle directory di proto e le versioni di Node e dei pacchetti elencate. Esamina come vengono passati gli argomenti con wildcard a proto-loader-gen-types e conferma che i pattern supportati generano gli stessi tipi di un input singolo user/v1/user.proto senza l'errore ENOENT.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
4.8k
Fork
716
Merge medio
1g 18h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di grpc/grpc-node

Tutte le issue di grpc/grpc-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.