b1az

b1az

Mix warning won't resolve

I’m still getting "a previous clause at line 1 always matches" warning below, even though I long ago removed the .ex file that was re-defining the problematic DefineMessage module from exprotobuf:

> mix deps.compile
> mix compile

==> my_app
Compiling 13 files (.ex)
warning: this clause cannot match because a previous clause at line 1 always matches
  lib/exprotobuf/define_message.ex:1

This was indeed a valid warning for this project, as it used to contain a same-named module DefineMessage. The module was in a file under config/, and on deployment it would overwrite exprotobuf’s own module: we’d literally do

cp config/our_define_message.ex  \
  deps/exprotobuf/lib/exprotobuf/define_message.ex

A similar issue on GitHub was supposedly already resolved.

In despair, grep from the project root, with grouped output between .elixir_ls/, _build/ and deps/:

> grep -R DefineMessage .

Binary file ./.elixir_ls/dialyzer_tmp/.elixir_ls/build/_test/lib/exprotobuf/ebin/Elixir.Protobuf.Builder.beam matches
Binary file ./.elixir_ls/dialyzer_tmp/.elixir_ls/build/_test/lib/exprotobuf/ebin/Elixir.Protobuf.DefineMessage.beam matches
./.elixir_ls/build/_test/lib/exprotobuf/ebin/exprotobuf.app:                        'Elixir.Protobuf.DefineMessage',
Binary file ./.elixir_ls/build/_test/lib/exprotobuf/ebin/Elixir.Protobuf.Builder.beam matches
Binary file ./.elixir_ls/build/_test/lib/exprotobuf/ebin/Elixir.Protobuf.DefineMessage.beam matches

Binary file ./_build/dev/lib/my_app/.mix/compile.app_tracer matches

./_build/dev/lib/exprotobuf/ebin/exprotobuf.app:                        'Elixir.Protobuf.DefineMessage',
Binary file ./_build/dev/lib/exprotobuf/ebin/Elixir.Protobuf.Builder.beam matches
Binary file ./_build/dev/lib/exprotobuf/ebin/Elixir.Protobuf.DefineMessage.beam matches

grep: ./deps/setup/xtest/testapp-2/rebar: No such file or directory
grep: ./deps/setup/xtest/testapp-1/rebar: No such file or directory

./deps/exprotobuf/lib/exprotobuf/define_message.ex:defmodule Protobuf.DefineMessage do
./deps/exprotobuf/lib/exprotobuf/builder.ex:  import Protobuf.DefineMessage, only: [def_message: 3]

Any ideas where the issue might lie much appreciated.

First Post!

patfranciso

patfranciso

Try
$ mix clean

before

$ mix compile

Most Liked

mfilej

mfilej

FWIW this turned out to be because we were accidentally defining a field twice with the same name.

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement