question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Buf generated duplicate file with protoc-gen-ts

See original GitHub issue
# buf.yaml
version: v1
deps:
  - buf.build/googleapis/googleapis
# buf.gen.yaml
version: v1

plugins:
  - name: ts
    out: ./proto
    opt:
      - generate_dependencies
      - long_type_string
      - client_generic
      - server_none
    path: ./node_modules/.bin/protoc-gen-ts

The output of buf generate:

Warning: Duplicate generated file name "google/protobuf/descriptor.ts". Buf will continue without error here and drop the second occurrence of this file, but please raise an issue with the maintainer of the plugin.
Warning: Duplicate generated file name "google/api/http.ts". Buf will continue without error here and drop the second occurrence of this file, but please raise an issue with the maintainer of the plugin.

protoc-gen-ts may need to ignore files that have already been generated.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
timostammcommented, Sep 30, 2021

strategy: all is the correct setting. While most plugins need the default directory strategy, protobuf-ts doesn’t.

I’ve added an example that also works with dependencies from the BSR.

1reaction
sorcererxwcommented, Sep 28, 2021

This might be an effective solution, provide packages like @protobuf-ts/google-api/@protobuf-ts/well-known-types and let the generated code import them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Duplicate generated file name #366 - stephenh/ts-proto
I encountered the following warning when using. http://buf.build Import ... Warning: Duplicate generated file name "google/protobuf/any.ts".
Read more >
Usage - Buf docs - Buf.build
All buf operations rely on building, or compiling, Protobuf files. The linter, breaking change detector, generator, and the BSR are features that rely...
Read more >
How to avoid copying vendor proto dependencies on buf ...
My question is, whenever I run buf generate --path=./proto (please notice path is set as a directory), I get googleapis pb.go files copied...
Read more >
Generating stubs using buf | gRPC-Gateway - GitHub Pages
yaml file, or direct JSON or YAML data. As opposed to protoc , where all .proto files are manually specified on the command-line,...
Read more >
Generating code
Generating code. We mentioned earlier that the ELIZA service defines a Protocol Buffer schema. So what is that schema? It is really just...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found