Closed niccolox closed 3 years ago
I suspect that having ex_money
in your applications: [....]
list may be the issue. These days you shouldn't need to do anything except add it to deps
.
Would you mind removing ex_money
from applications
and trying again?
OK, did that and get the same error first time I try mix phx.server, second time I restart it runs
866 MIX_ENV=dev mix deps.clean --all
867 MIX_ENV=dev mix deps.get --all
868 MIX_ENV=dev iex -S mix phx.server
errors
874 MIX_ENV=dev iex -S mix phx.server
works
Thats unusual and I haven't seen it before, apologies that you're treading a new path. I'll keep the issue open for a while in case you see a reoccurence.
thanks, closing
Seeing this issue, but for me it only showed up for me when running MIX_ENV=prod mix compile
and getting the following:
Generated ex_money_sql app
==> phoenix_ecto
Compiling 7 files (.ex)
Generated phoenix_ecto app
==> <your-app-name>
Unchecked dependencies for environment prod:
* ex_money (Hex package)
could not find an app file at "_build/prod/lib/ex_money/ebin/ex_money.app". This may happen if the dependency was not yet compiled or the dependency indeed has no app file (then you can pass app: false as option)
** (Mix) Can't continue due to errors on dependencies
It happens the first time when I run mix.compile, but if I re-run it a second time it compiles successfully. Running Elixir 1.12.0 (compiled with Erlang/OTP 22)
Thats very strange. ex_money
is definitely a dependency and yet its not being compiled (it should compile before ex_money_sql
). Any chance your repo is public so I can try to reproduce and debug? Does it in fact compile ex_money
first (your snippet above seems to be cut after the start of the compilation run)?
It is not public, but I shared the private repo with you (it's a WIP needs a bit of cleanup). I followed along during the compilation and it doesn't look like it compiles ex_money at all on the first run. I can see __build/prod/lib/ex_money_sql/ebin/ex_moneysql.app is built, but not __build/prod/lib/ex_money/ebin/exmoney.app
The following gist shows a dokku build, but getting the same error building prod locally as well: https://gist.github.com/phil-a/cab67e3ff7e237167ad601e7cffc2dbf
Let me know if I can help in any way!
Looking at the log of the gist you sent (thanks, very helpful) I think the issue is related to your mix.exs
configuration which has:
{:money, "~> 1.8"},
{:ex_money_sql, "~> 1.0"},
{:ex_cldr, "~> 2.0"},
:money
is a different lib to :ex_money
(mine is :ex_money
) and this is causing the module clashes you see since both libraries use the Money
module name.
:ex_money_sql
pulls in ex_money
which in turn pulls in ex_cldr
so you should only need to have:
{:ex_money_sql, "~> 1.0"},
Any chance you could give that a try and see if you see the error still?
Think this was related to same issue as #128 (or at least the same solution). After I made that change I've rebuilt several times and have yet to see that error.
I am getting this on Mac and Ubuntu
mix.exs
applications
versions