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

There's something wrong to get .[...] type #351

Open
tdtadeu opened this issue May 4, 2023 · 1 comment
Open

There's something wrong to get .[...] type #351

tdtadeu opened this issue May 4, 2023 · 1 comment
Assignees
Labels
Kind:Bug A bug. Can be a documentation bug, Dialyzer issue, or anything that just "doesn't work".

Comments

@tdtadeu
Copy link

tdtadeu commented May 4, 2023

Hey everyone! First of all, thank you for this great lib! ❤️

I just came across this issue that literally asks me to contact the lib author, so here I am 🤣

I'm trying to use import public from a shared.proto file to aggregate multiple packages in one file; Then, in another proto, I import shared.proto and try to use one of the packages imported in it. As soon as I try to run protoc it gives me the error:

$ protoc --elixir_out=./lib ./**/*.proto
** (RuntimeError) There's something wrong to get .mypackage.arm_status.ArmStatus's type, please contact with the lib author.
    (protobuf 0.12.0) lib/protobuf/protoc/generator/util.ex:63: Protobuf.Protoc.Generator.Util.type_from_type_name/2
    (protobuf 0.12.0) lib/protobuf/protoc/generator/message.ex:136: Protobuf.Protoc.Generator.Message.get_field/4
    (protobuf 0.12.0) lib/protobuf/protoc/generator/message.ex:106: anonymous fn/5 in Protobuf.Protoc.Generator.Message.get_fields/2
    (elixir 1.14.3) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
    (protobuf 0.12.0) lib/protobuf/protoc/generator/message.ex:106: Protobuf.Protoc.Generator.Message.get_fields/2
    (protobuf 0.12.0) lib/protobuf/protoc/generator/message.ex:32: Protobuf.Protoc.Generator.Message.generate/2
    (elixir 1.14.3) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (protobuf 0.12.0) lib/protobuf/protoc/generator/message.ex:24: Protobuf.Protoc.Generator.Message.generate_list/2
--elixir_out: protoc-gen-elixir: Plugin failed with status code 1.

I created an example project that you can use to reproduce the error here: https://github.com/tdtadeu/proto-error

And just for context, in case you wonder, the reason why I defined those enums in different files is because Protobuf won't allow me to use the same value for different enums (in my example, leg_status.proto and arm_status.proto both define values up, down and unknown).

I hope this is enough information, but if not please let me know how else I can help.

@whatyouhide whatyouhide added the Kind:Bug A bug. Can be a documentation bug, Dialyzer issue, or anything that just "doesn't work". label May 5, 2023
@whatyouhide whatyouhide changed the title There's something wrong to get .[...] type, please contact with the lib author There's something wrong to get .[...] type May 11, 2024
@mruoss
Copy link

mruoss commented Oct 7, 2024

is there a way to work around this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kind:Bug A bug. Can be a documentation bug, Dialyzer issue, or anything that just "doesn't work".
Projects
None yet
Development

No branches or pull requests

4 participants