bufbuild / buf

The best way of working with Protocol Buffers.

Home Page:https://buf.build

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Field plugin not found in type bufgen.ExternalPluginConfigV1

tech-scripter opened this issue Β· comments

Hello there πŸ‘‹

I try to generate stabs using the buf generate, however I get the error below:

buf generate 

Failure: could not unmarshal as YAML: yaml: unmarshal errors:
  line 18: field plugin not found in type bufgen.ExternalPluginConfigV1
  line 25: field plugin not found in type bufgen.ExternalPluginConfigV1

Here is my buf.gen.yaml

version: v1
managed:
  enabled: true
  go_package_prefix:
    default: golang-miniproject/gen
plugins:
  - name: go
    out: protos-gen-go
    opt: paths=source_relative
  - name: go-grpc
    out: protos-gen-go
    opt: paths=source_relative
  - name: grpc-gateway
    out: protos-gen-go
    opt:
      - paths=source_relative
      - generate_unbound_methods=true
  - plugin: buf.build/bufbuild/validate-go (line 18)
    out: protos-gen-go
    opt:
      - lang=go
      - paths=source_relative
  - name: openapiv2
    out: openapiv2
  - plugin: buf.build/protocolbuffers/go (line 25)
    out: protos-gen-go
    opt: paths=source_relative
buf --version
1.6.0

What's more, I observe such behavior only when working on MacOS.

Thank you in advance!

The issue is resolved.

The error occurred because the built-in CLI in GoLand IDEA was working with an older version of Buf, while the MacOS CLI was operating with the latest one. I uninstalled Buf and reinstalled it again.