drowzy / protobuf_generate

Protobuf code generation as a mix task
MIT License
10 stars 3 forks source link

(UndefinedFunctionError) function ProtobufGenerate.Plugins.Enum.template/1 is undefined or private #4

Closed kevinkl3 closed 2 months ago

kevinkl3 commented 5 months ago

Hi, I get the following error while trying to generate the code for a couple of proto files.

mix protobuf.generate --generate-descriptors=true --output-path ./lib/ --plugin=ProtobufGenerate.Plugins.GRPC --include-path ./proto/ ./proto/*.proto

** (UndefinedFunctionError) function ProtobufGenerate.Plugins.Enum.template/1 is undefined or private. Did you mean:

      * template/0

    (protobuf_generate 0.1.2) ProtobufGenerate.Plugins.Enum.template(%{})
    (protobuf_generate 0.1.2) lib/protobuf_generate/code_gen.ex:51: ProtobufGenerate.CodeGen.eval/2
    (protobuf_generate 0.1.2) lib/protobuf_generate/code_gen.ex:33: anonymous fn/3 in ProtobufGenerate.CodeGen.eval/2
    (elixir 1.14.5) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
    (protobuf_generate 0.1.2) lib/protobuf_generate/code_gen.ex:33: ProtobufGenerate.CodeGen.eval/2
    (protobuf_generate 0.1.2) lib/protobuf_generate/code_gen.ex:33: anonymous fn/3 in ProtobufGenerate.CodeGen.eval/2
    (elixir 1.14.5) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
    (protobuf_generate 0.1.2) lib/protobuf_generate/code_gen.ex:33: ProtobufGenerate.CodeGen.eval/2

Environment:

Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:1] [jit:ns]
IEx 1.14.5 (compiled with Erlang/OTP 24)
Mix 1.14.5 (compiled with Erlang/OTP 24)
Elixir 1.14.5 (compiled with Erlang/OTP 24)

I am new to elixir/otp so I am not sure if I am doing anything wrong.

Thanks in advance

drowzy commented 2 months ago

Fixed in #7