How to disable "redefining" warning?

When calling Code.compile_quoted which recompiles existing module I constantly get this warning:

warning: redefining module TheModule (current version loaded from _build/dev/lib/defbug/ebin/Elixir.TheModule.beam)

I’ve tried purging modules before recompilation and such stuff, but warning remains present.

How do I turn this off?

1 Like

There is --ignore-module-conflict under elixirc though I can’t figure out how to pass these options to iex.

if you are using Code.compiled_quoted in IEx you can achieve the above by using Code.put_compiler_option/2

Code.put_compiler_option(:ignore_module_conflict, true)

in your dot iex file.

Otherwise if you’re compiling with mix you can access the above option with mix compile --ignore-module-conflict.
And you can set it as default in your mix.exs file under the project def, I think:

  def project do
       elixirc_options: [ignore_module_conflict: true]
Code.put_compiler_option(:ignore_module_conflict, true)

This code solves the problem, thanks!

1 Like