Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): fix relative path to Google pb files #1859

merged 1 commit into from
Feb 2, 2023


Copy link

@gitjuba gitjuba commented Jan 31, 2023

Upgrading from 6.7 to 7.0 we encountered a possible bug in resolving the paths to the included Google protobuf files. With the older version, when the CLI was bundled in the same library, on line 81 of cli/pbjs.js, __dirname was [..]/node_modules/protobufjs/cli, so path.join(__dirname, "..") evaluated to [..]/node_modules/protobufjs, but now __dirname is [..]/node_modules/protobufjs-cli, so path.join(__dirname, "..") is just [..]/node_modules, and later, on lines 198--200, protobuf files are searched from a non-existing folder, for example [..]/node_modules/google/protobuf/descriptor.proto.

This PR inserts the missing protobufjs directory to the search path.

@alexander-fenster alexander-fenster changed the title CLI: Fix relative path to Google pb files fix(cli): fix relative path to Google pb files Feb 2, 2023
@alexander-fenster alexander-fenster merged commit e42eea4 into protobufjs:master Feb 2, 2023
@github-actions github-actions bot mentioned this pull request Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants