mafintosh / mafintosh/protocol-buffers

Cannot reference type with package name

Open
#53 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
760
Forks
75
PR merge metrics
No merged PRs in 30d

Description

I have .proto file with following structure:

package A;

message AB
{
…
}

message AC
{
  optional A.AB ab_field = 1;
}

Compilation fails if I use message name prefixed with package name.

Error: Could not resolve VoiceProxyProtobuf.AlignInfo
    at resolve (XXX/protocol-buffers/compile.js:502:19)
    at XXX/protocol-buffers/compile.js:185:14
    at Array.map (native)
    at compileMessage (XXX/protocol-buffers/compile.js:184:24)
    at resolve (XXX/protocol-buffers/compile.js:505:27)
    at XXX/protocol-buffers/compile.js:509:12
    at Array.map (native)
    at module.exports (XXX/protocol-buffers/compile.js:508:62)
    at new Messages (XXX/protocol-buffers/index.js:14:5)
    at module.exports (XXX/protocol-buffers/index.js:27:10)

Here is complete .proto file:

https://gist.github.com/apla/c20edbf071e13b3cf93d

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the failure with the complete .proto file linked in the issue, then inspect type resolution in compile.js around lines 185 and 502 from the stack trace. Done means a message referenced with its package-qualified name compiles successfully without the reported resolution error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.