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

Unresolvable field type for nested fields. #595

Closed
ashubham opened this issue Dec 29, 2016 · 4 comments
Closed

Unresolvable field type for nested fields. #595

ashubham opened this issue Dec 29, 2016 · 4 comments
Labels

Comments

@ashubham
Copy link

ashubham commented Dec 29, 2016

protobuf.js version: 6.3.1

In prior versions of protobufjs (4.0/5.0) this used to compile fine, and also with the google proto compiler. But when trying to generate a static module or using the json I get the following error for some fields in my .proto. All of these fields are actually nested fields like the one below:

import "net/trace/trace.proto"
package net.rpc;

message RpcDebugInfo {
  extend TraceEvent {
    optional RpcDebugInfo trace = 1008;
  }
  optional int64 size = 1;
}

This is the error:

Error: Unresolvable field type: RpcDebugInfo
@dcodeIO
Copy link
Member

dcodeIO commented Dec 30, 2016

Is it correct to assume that the full names of the messages in question are .net.trace.TraceEvent and .net.rpc.RpcDebugInfo?

If so, does the same happen if you change extend TraceEvent to extend trace.TraceEvent?

dcodeIO added a commit that referenced this issue Dec 30, 2016
dcodeIO added a commit that referenced this issue Dec 30, 2016
@dcodeIO dcodeIO added the unsure label Dec 30, 2016
@dcodeIO
Copy link
Member

dcodeIO commented Jan 3, 2017

Closing this issue for now as it hasn't received any replies recently. Feel free to reopen it if necessary!

@dcodeIO dcodeIO closed this as completed Jan 3, 2017
@chabb
Copy link

chabb commented Jan 24, 2017

Looks like changing extend TraceEvent to extend trace.TraceEvent solve the issue..

@dcodeIO
Copy link
Member

dcodeIO commented Jan 24, 2017

Afaik this is also the intended behavior.

With TraceEvent, lookup is:

  • TraceEvent in net.rpc? no, search parent
  • TraceEvent in net? no, search parent
  • TraceEvent in root? no, throw

With trace.TraceEvent, it is:

  • trace in net.rpc? no, search parent
  • trace in net yes, search child for (remaining) TraceEvent
  • TraceEvent in net.trace? yes, return TraceEvent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants