Skip to content

Changing behavior working when use file from input as import #1855

@d-enk

Description

@d-enk

protobuf.js version: 7.2.0

After this change command
pbjs proto/a.proto proto/b.proto
returns error
Error: ENOENT: no such file or directory, open 'proto/proto/a.proto'

for this proto

// ./proto/a.proto
syntax = "proto3";
package proto;

message A {}
// ./proto/b.proto
syntax = "proto3";
package proto;

import "proto/a.proto";

message B {
  A a = 1;
}

This will work if you add the current context into include path
pbjs proto/a.proto proto/b.proto -p .

Also the correct result can be achieved by replacing import "proto/a.proto" with import "a.proto";
that should not work
(buf build return proto/b.proto:4:8:a.proto: does not exist)

Perhaps for such cases it was always necessary to explicitly specify the include path. (which is weird in my opinion)
But I think I'm not the only one who will face this after the update and I hope this issue helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions