Customized Mix.Tasks.Phx.Gen.Html => Duplicated modules: 'Elixir.Mix.Tasks.Phx.Gen.Html'

I am overriding the default Mix.Tasks.Phx.Gen.Html to generate my custom html code. It was working all well till I upgraded phoenix the last time. When I run mix release now, I get the following error:

Duplicated modules:
‘Elixir.Mix.Tasks.Phx.Gen.Html’ specified in my_app and phoenix

I tried to google the problem but I couldn’t find a solution. Maybe someone of you got an idea?

1 Like

Would creating your own mix task solve the issue? You should be able to create an alias in mix.exs and hide the original one.

1 Like

no, because when I google for the task, I will always forget about my custom one. I only want to override the original templates so I don’t need to manually change all of my templates again and can save some of that repetitive work

1 Like

Define your template using a different module name and then add an alias to your mix.exs that replaces phx.gen.html by your task :slight_smile:

1 Like