mapbox / mapbox/pbf

Error using google.protobuf.Any

Open
#117 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug question
Dominant language
JavaScript
Stars
881
Forks
113
PR merge metrics
No merged PRs in 30d

Description

Sandbox: https://repl.it/repls/GleamingWhimsicalInformationtechnology

pbf fails to compile this proto


message RequestEnvelope {
    string correlationId = 1;
    string callPath = 2;
    google.protobuf.Any payload = 3;
}

with

./node_modules/pbf/compile.js:157
default:  throw new Error('Unexpected type: ' + field.type);
 
Error: Unexpected type: google.protobuf.Any
at compileFieldRead (./node_modules/pbf/compile.js:157:28)

Is it known that it's not supported or am I doing something wrong?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with compile.js around line 157 and reproduce the failure using the provided Repl.it sandbox and proto snippet containing google.protobuf.Any. Trace how field types are handled, then verify that this proto compiles without the reported Unexpected type error and that the resulting behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.