Can't deploy Elixir application with duplicated modules

I have an Elixir application in which I purposely created a module with the same name of another one from a dependency. I needed a way to overwrite some behavior on a dependency and that was the easiest way I could find (although I know it’s a very hacky approach and not ideal, but I had to do it on the short term).

The problem is that I can’t deploy my app now, since Fly.io will show a build error saying (Mix) Duplicated modules.

Is there a way to ignore this and still deploy, or is this a hard requirement for deploying Elixir apps?

Hi… No, the only real requirement is that you build and upload a Docker-style image—via whatever means.

The “very hacky” aspect might make this more effort than it’s worth, though…

How were you compiling locally, when things did work?

On my local environment, I added elixirc_options: [ignore_module_conflict: true] to MyApp.MixProject.project/0. But I’m rolling back my changes and removing the hack I initially did. Please ignore my ask. I really shouldn’t be overriding modules this way.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.