googleapis / nodejs-proto-files

All of the Google API's protocol buffer files
Apache License 2.0
76 stars 18 forks source link

Invalid paths resolving #491

Open KonstantinSerebryakov opened 4 months ago

KonstantinSerebryakov commented 4 months ago

The problem occured loading cloud/texttospeech/v1/cloud_tts_lrs.proto. It try to load the related file with duplicated path. The substring of the path is duplicated in the error message ("google\cloud\texttospeech\v1\google\cloud\texttospeech\v1" - is repeated twice in path)

Steps to reproduce

  1. Run the code
  2. See the error

Code:

import * as protos from "google-proto-files";

const paths = {
  v1: protos.getProtoPath("cloud/texttospeech/v1/cloud_tts.proto"),
  v1_lrs: protos.getProtoPath("cloud/texttospeech/v1/cloud_tts_lrs.proto"),
};

protos.loadSync(
  paths.v1_lrs
);

Error message:

Error: ENOENT: no such file or directory, open 'C:\PROJECTS\google_ai_text_to_speech\node_modules\google-proto-files\google\cloud\texttospeech\v1\google\cloud\texttospeech\v1\cloud_tts.proto'