Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
621 views
in Technique[技术] by (71.8m points)

elixir - (CaseClauseError) no case clause matching: %{syntax: :proto2}

I have an app that requires diplomat Elixir package and grpc Elixir package, but as soon as I am adding both of them together in the (mix.exs file) dependency it returns me the following error while executing mix deps.compile command

warning: redefining module Protobuf.Encoder (current version loaded from /Users/username/all/blockers/protobuf-error/request-handler/_build/dev/lib/exprotobuf/ebin/Elixir.Protobuf.Encoder.beam)
  lib/protobuf/encoder.ex:1


== Compilation error in file lib/google/compiler/plugin.pb.ex ==
** (CaseClauseError) no case clause matching: %{syntax: :proto2}
    expanding macro: Protobuf.__using__/1
    lib/google/compiler/plugin.pb.ex:3: Google.Protobuf.Compiler.Version (module)
    (elixir 1.11.2) expanding macro: Kernel.use/2
    lib/google/compiler/plugin.pb.ex:3: Google.Protobuf.Compiler.Version (module)
could not compile dependency :protobuf, "mix compile" failed. You can recompile this dependency with "mix deps.compile protobuf", update it with "mix deps.update protobuf" or clean it with "mix deps.clean protobuf".

If I comment on one of either dependency then I get the exact same error while executing mix sobelow --config command.

Version details::

  • Elixir : 1.5
  • Erlang: Erlang/OTP 18
  • Protobuf: latest (0.7.1)
  • GRPC: latest (from repo)
  • Diplomat: 0.2

Analysis so far:

Diplomat library requires exprotobuf for its internal dependencies while GRPC requires basic google-protobuf which is conflicting in the application.

Any help will be appreciated, thank you.

[Edit]:

defp deps do
    [
      {:phoenix, "~> 1.4.0"},
      {:phoenix_pubsub, "~> 1.1"},
      {:phoenix_ecto, "~> 4.0"},
      {:ecto_sql, "~> 3.0"},
      {:postgrex, ">= 0.0.0"},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.0"},
      {:plug_cowboy, "~> 2.0"},
      {:httpoison, "~> 1.5"},
      {:elixir_uuid, "~> 1.2"},
      {:distillery, "~> 2.0"},
      {:timex, "~> 3.5"},
      {:logger_json, "~> 3.0.2"},
      {:google_api_storage, "~> 0.1"},
      {:goth, "~> 0.8.0"},
      {:exmagick, "~> 0.0.1"},
      {:mime, "~> 1.2"},
      {:mogrify, "~> 0.6.1"},
      {:gen_rmq, git: "https://github.com/akashsethiya/gen_rmq"},
      {:levenshtein, "~> 0.2.0"},
      # {:exredis, ">= 0.2.4"},
      {:appsignal, "~> 1.0"},
      {:magic_number, "~> 0.0.4"},
      {:google_api_pub_sub, "~> 0.3.0"},
      {:diplomat, "~> 0.2"},
      {:sparkpost, "~> 0.5.1"},
      {:jose, "~> 1.9"},
      {:redix, ">= 0.0.0"},
      {:libcluster, "~> 3.0"},
      {:mix_audit, "~> 0.1.4", only: [:dev, :test], runtime: false},
      {:sobelow, "~> 0.10.4", only: [:dev, :test]},
      {:cowlib, "~> 2.9.0", override: true},
      {:gun, "~> 2.0.0", hex: :grpc_gun, override: true},
      {:grpc, github: "elixir-grpc/grpc"},
      {:protobuf, "~> 0.7.1"}
    ]
  end
question from:https://stackoverflow.com/questions/65913980/caseclauseerror-no-case-clause-matching-syntax-proto2

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.6k users

...