Beacon's mix.exs specifies {:gettext, "~> 0.26"}, which prevents installation in Phoenix 1.8 projects that require {:gettext, "~> 1.0"}.
Because "your app" depends on "beacon ~> 0.5" which depends on "gettext ~> 0.26",
"gettext ~> 0.26" is required.
So, because "your app" depends on "gettext ~> 1.0", version solving failed.
The fix is trivial — Beacon's codebase already uses the gettext 1.0-compatible API everywhere:
lib/beacon/gettext.ex uses use Gettext.Backend, otp_app: :beacon
- All consumers use
use Gettext, backend: Beacon.Gettext
translate_error/1 calls Gettext.dngettext/6 and Gettext.dgettext/4 directly (not deprecated macros)
The only change needed is in mix.exs:
- {:gettext, "~> 0.26"},
+ {:gettext, "~> 0.26 or ~> 1.0"},
This maintains backward compatibility with gettext 0.26 while allowing gettext 1.0+.
Steps to reproduce:
mix phx.new my_app (Phoenix 1.8)
- Add
{:beacon, "~> 0.5"} to deps
mix deps.get → Hex resolution failure
Environment:
- Elixir 1.18+ / OTP 27
- Phoenix 1.8 (ships with
{:gettext, "~> 1.0"})
- Beacon 0.5.x and main branch
Beacon's
mix.exsspecifies{:gettext, "~> 0.26"}, which prevents installation in Phoenix 1.8 projects that require{:gettext, "~> 1.0"}.The fix is trivial — Beacon's codebase already uses the gettext 1.0-compatible API everywhere:
lib/beacon/gettext.exusesuse Gettext.Backend, otp_app: :beaconuse Gettext, backend: Beacon.Gettexttranslate_error/1callsGettext.dngettext/6andGettext.dgettext/4directly (not deprecated macros)The only change needed is in
mix.exs:This maintains backward compatibility with gettext 0.26 while allowing gettext 1.0+.
Steps to reproduce:
mix phx.new my_app(Phoenix 1.8){:beacon, "~> 0.5"}to depsmix deps.get→ Hex resolution failureEnvironment:
{:gettext, "~> 1.0"})