improbable-eng / ts-protoc-gen

Protocol Buffers Compiler (protoc) plugin for TypeScript and gRPC-Web.
Apache License 2.0
1.37k stars 172 forks source link

Non-message extension fields cause 0.14.1 to fail #273

Closed pkwarren closed 3 years ago

pkwarren commented 3 years ago

When testing the latest version (0.14.1) against a .proto file that defines extensions with primitive field types, we're now hitting an error during generation of the typescript types.

Versions of relevant software used

0.14.1 (not published to NPM but fetched via github ref)

What happened

ts-protoc-gen failed with an error.

What you expected to happen

No errors during type generation. The same proto files compile on 0.14.0.

How to reproduce it (as minimally and precisely as possible):

Create an extension that uses non-message field types, i.e.:

extend google.protobuf.MessageOptions {
  bool my_field = 5000;
}

Full logs to relevant components

Logs

``` protoc-gen-ts error: Error: Missing extension type name - This is unhandled behaviour and should be reported as an issue on https://github.com/improbable-eng/ts-protoc-gen/issues at Object.throwError (.../node_modules/ts-protoc-gen/lib/util.js:12:15) at Object.printExtension (.../node_modules/ts-protoc-gen/lib/ts/extensions.js:11:63) ```

Anything else we need to know

n/a