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

Missing import with loadSync is not thrown #1725

Open
steinybot opened this issue May 16, 2022 · 2 comments · May be fixed by #1726
Open

Missing import with loadSync is not thrown #1725

steinybot opened this issue May 16, 2022 · 2 comments · May be fixed by #1726

Comments

@steinybot
Copy link
Contributor

protobuf.js version: 6.10.2

syntax = "proto3";

import "no/such/file.proto";

message Something {
  ImportedType field = 1;
}
root.loadSync("missing-import.proto")

This should throw an error if "no/such/file.proto" does not exist but it does not.

steinybot added a commit to steinybot/protobuf.js that referenced this issue May 16, 2022
@steinybot steinybot linked a pull request May 16, 2022 that will close this issue
@ccakes
Copy link

ccakes commented Jun 14, 2022

This doesn't just apply to missing imports, this seems to apply for all syntax errors.

syntax = "proto3";

message Foo {
  string name = 1;;
}

Whether or not this is an actual syntax error.. tbd. protoc is fine with it. Regardless, protobufjs silently swallows this but with the linked MR it's bubbled up correctly.

steinybot added a commit to steinybot/protobuf.js that referenced this issue Sep 8, 2022
steinybot added a commit to steinybot/protobuf.js that referenced this issue Sep 8, 2022
@yrtimiD
Copy link
Contributor

yrtimiD commented Jul 30, 2023

The issue is still present in v7.2.3 and the proposed fix works fine. Any hope this will be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants