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

Protobuf.js cannot parse fields with message values inside of custom field option messages #1428

Closed
murgatroid99 opened this issue Jun 17, 2020 · 0 comments · Fixed by #1429

Comments

@murgatroid99
Copy link
Contributor

protobuf.js version: 6.9.0

Protobuf.js fails to parse this .proto file, throwing this error:

Error: illegal name '}' (deps/envoy-api/envoy/api/v2/core/http_uri.proto, line 53)
    at illegal (/mnt/d/Documents/grpc-node/packages/grpc-js/node_modules/protobufjs/src/parse.js:94:16)
    at parseOptionValue (/mnt/d/Documents/grpc-node/packages/grpc-js/node_modules/protobufjs/src/parse.js:561:27)
    at parseOptionValue (/mnt/d/Documents/grpc-node/packages/grpc-js/node_modules/protobufjs/src/parse.js:564:21)
    at parseOption (/mnt/d/Documents/grpc-node/packages/grpc-js/node_modules/protobufjs/src/parse.js:553:9)
    at parseInlineOptions (/mnt/d/Documents/grpc-node/packages/grpc-js/node_modules/protobufjs/src/parse.js:587:17)
    at parseField_line (/mnt/d/Documents/grpc-node/packages/grpc-js/node_modules/protobufjs/src/parse.js:378:13)
    at ifBlock (/mnt/d/Documents/grpc-node/packages/grpc-js/node_modules/protobufjs/src/parse.js:292:17)
    at parseField (/mnt/d/Documents/grpc-node/packages/grpc-js/node_modules/protobufjs/src/parse.js:368:9)
    at parseType_block (/mnt/d/Documents/grpc-node/packages/grpc-js/node_modules/protobufjs/src/parse.js:340:21)
    at ifBlock (/mnt/d/Documents/grpc-node/packages/grpc-js/node_modules/protobufjs/src/parse.js:288:17)

referring to this field of the message:

  google.protobuf.Duration timeout = 3 [(validate.rules).duration = {
    required: true
    gte {} // This is the line the error refers to
  }];

The protoc tool parses this file just fine, so this is a valid protobuf definition.

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

Successfully merging a pull request may close this issue.

1 participant