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.

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

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
Kagamiiiii
Student & New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
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
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement