Skip to content

Treat absolute paths as relative #1863

@ddimitrioglo

Description

@ddimitrioglo

protobuf.js version: 7.2.0

We have a package @packaly/core-sdk package where we store all the proto files and generated files.
After the last dependencies reinstallation, seems that the path resolution got broken.
After investigation, I could drill down to protobufjs which is an indirect dependency for our package.

The structure:

├── package.json
└── packaly
    ├── backend
    │   └── v1
    │        ...
    │       ├── store.pb.js
    │       ├── store.pb.ts
    │       └── store.proto
    ├── common
    │    ...
    │   ├── geo.pb.js
    │   ├── geo.pb.ts
    │   └── geo.proto
    ...

The store.proto

syntax = "proto3";

package packaly.backend.v1;

import "packaly/common/geo.proto"; // <== THIS import fails

service StoreService {
  // some rpcs here
}

with version 7.2.0 (which is installed automatically via the dependency tree) I get the following error:

ENOENT: no such file or directory, open '/MY-PROJECT/node_modules/@packaly/core-sdk/packaly/backend/v1/packaly/common/geo.proto'
Error: The invalid .proto definition (file not found)

when I update my package.json with "protobufjs": "7.1.2" everything works as expected.

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