Why my my phoenix project has some "Prelude" modules being redefined?

I migrated to NixOS and it’s being such a great option to create reproducible dev environment and all elixir-erlang related packges are awesome. So I created a shell.nix file as:

but every time I compile my project I get these warnings:

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/collectable.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/collectable.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/collectable.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/collectable.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/collectable.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/enum.ex:1

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/string/chars.ex:3

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/iex/info.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/iex/info.ex:1

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/iex/info.ex:1

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

warning: this clause cannot match because a previous clause at line 6 always matches
  lib/inspect.ex:6

Any bets?

Protocols - it may be that the precompiled modules (due to protocol consolidation) conflicts with non-precompiled dispatcher. The solution is to set ERL_LIBS=.

However that is only my hypothesis.

Thanks for the reply!

I found this issue: elixir's setupHook causes compiler to emit warnings for all code · Issue #85265 · NixOS/nixpkgs · GitHub

but is kinda old… I’ll dig into about more information

setting up ERL_LIBS env var solves the problem (: