protobuf.js icon indicating copy to clipboard operation
protobuf.js copied to clipboard

Changing behavior working when use file from input as import

Open d-enk opened this issue 2 years ago • 1 comments

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.

d-enk avatar Jan 25 '23 15:01 d-enk