DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,904 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Sushant Bajracharya
Sushant Bajracharya

Posted on

Understanding "warning: redefining module x" in elixir

Take this article with a grain of salt.

This particular warning is telling you that even after loading the module, elixir is trying to recompile it.

There are different ways to clear such warning in the internet like removing the _build directory. It did not work for me initially.

In my case, I had an unused variable in my eex file. Since my project was configured to treat warnings as error in my credo setting, it failed to compile leaving me with a lot of "redifing module" warnings. And in that noise, another warning was hidden which pointed out on prefixing the unused variable.

After prefixing the unused variable and mix do clean, phx.server, those warnings went away

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.