Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buf grpc/web generate error: options: mode is required #2087

Closed
ihatemodels opened this issue May 15, 2023 · 1 comment
Closed

buf grpc/web generate error: options: mode is required #2087

ihatemodels opened this issue May 15, 2023 · 1 comment

Comments

@ihatemodels
Copy link

ihatemodels commented May 15, 2023

I am trying to setup a grpc/web client and i get the following error:

Failure: plugin "buf.build/grpc/web:v1.4.2" failed: health.proto: options: mode is required

The error specifically occurs when using gRPC-Web, while other plugins do not seem to be affected. This issue has been reported here: grpc/grpc-web#1251

Buf version

➜  buf --version
1.17.0

heath.proto

syntax = 'proto3';

package health_proto.v1;

option csharp_namespace = "Grpc.Health.V1";
option go_package = "google.golang.org/grpc/health/grpc_health_v1";
option java_multiple_files = true;
option java_outer_classname = "HealthProto";
option java_package = "io.grpc.health.v1";

// Copyright 2015 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
message HealthCheckRequest {
  string service = 1;
}

message HealthCheckResponse {
  enum ServingStatus {
    UNKNOWN = 0;
    SERVING = 1;
    NOT_SERVING = 2;
    SERVICE_UNKNOWN = 3;  // Used only by the Watch method.
  }
  ServingStatus status = 1;
}

service Health {
  rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
  rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse);
}

buf.gen.yaml

version: v1
plugins:
  - plugin: buf.build/grpc/web:v1.4.2
    out: gen/web
  # dependencies
  - plugin: buf.build/protocolbuffers/js
    out: gen/web

  # Documentation
  - name: doc
    out: gen/doc
    opt: html,index.html
    strategy: all

buf.yaml

version: v1
breaking:
  use:
    - FILE
lint:
  use:
    - DEFAULT
@bufdev
Copy link
Member

bufdev commented May 15, 2023

As you've pointed out, this is a grpc-web issue, not a bufbuild/buf issue. The buf CLI works with all plugins, but cannot account for bugs within each plugin.

@bufdev bufdev closed this as completed May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants