Skip to content

order of imports matters? #1954

@alexander-fenster

Description

@alexander-fenster

[filing this mostly for myself, who else would go fix it? :) ]

v7.2.5

Twice during the last two weeks I noticed a proto that failed pbjs being unable to locate a type (even though all dependencies were provided) but passed after I reordered proto imports.

One of these protos is https://github.com/googleapis/googleapis/blob/master/google/cloud/compute/v1/compute.proto (warning, big file!) which required import "google/protobuf/any.proto"; to be listed first to make it work.

In another case, the sequence of

import "google/api/field_behavior.proto";
import "google/api/field_info.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "google/type/dayofweek.proto";
import "google/type/timeofday.proto";

did not work (saying that type of enum google.type.TimeOfDay cannot be found), while

import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "google/type/dayofweek.proto";
import "google/type/timeofday.proto";
import "google/api/field_behavior.proto";
import "google/api/field_info.proto";
import "google/api/resource.proto";

worked.

Something dodgy is going on in the parser, I will need to take a look at it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions