Skip to content

Money dependency conflicts with ExMoney dependency in project #1280

@PJUllrich

Description

@PJUllrich

Describe the bug
When I add Backpex to my project that depends on ExMoney, I receive the following compiler error half the times when compiling the project:

Unchecked dependencies for environment test:
* ex_money (Hex package)
  could not find an app file at "_build/test/lib/ex_money/ebin/ex_money.app". This may happen if the dependency was not yet compiled or the dependency indeed has no app file (then you can pass app: false as option)
** (Mix) Can't continue due to errors on dependencies

This probably happens because Backpex depends on money which for unfortunate reasons conflicts with ex_money which uses the same Money.* namespace.

To Reproduce
Steps to reproduce the behavior:

  1. Add Backpex to a project that depends also on ex_money.
  2. Compile the project a few times

Expected behavior
Money and ExMoney would not share the same Money.* namespace but that ship has sailed.

Maybe Backpex could instead make the money dependency optional and offer the Currency field only if the Money library is loaded? Ideally, it would support both libraries of course, but that'd be difficult since now you also use Money for storing currencies in the database through the amount_type.ex. Did you know that ExMoney offers such Ecto types out-of-the-box by the way? ;)

Maybe this doesn't have a solution though 🤷 I just wanted to put this out there.

Screenshots

Please complete the following information:

  • OS: macOS
  • Browser [e.g. chrome, safari]
  • Elixir Version: 1.18.4
  • Backpex Version: 0.13.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions