Fresh Phoenix v1.6 app gives warning about :gettext compiler

Using the following elixir and erlang on Ubuntu 22.04

Erlang/OTP 24 [erts-12.3.2.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Elixir 1.13.4 (compiled with Erlang/OTP 24)

On a fresh phoenix v1.6.11 app I am getting the following warning on launching the server

warning: the :gettext compiler is no longer required in your mix.exs.

Please find the following line in your mix.exs and remove the :gettext entry:

    compilers: [..., :gettext, ...] ++ Mix.compilers(),

  (gettext 0.20.0) lib/mix/tasks/compile.gettext.ex:5: Mix.Tasks.Compile.Gettext.run/1
  (mix 1.13.4) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
  (mix 1.13.4) lib/mix/tasks/compile.all.ex:92: Mix.Tasks.Compile.All.run_compiler/2
  (mix 1.13.4) lib/mix/tasks/compile.all.ex:72: Mix.Tasks.Compile.All.compile/4
  (mix 1.13.4) lib/mix/tasks/compile.all.ex:59: Mix.Tasks.Compile.All.with_logger_app/2
  (mix 1.13.4) lib/mix/tasks/compile.all.ex:36: Mix.Tasks.Compile.All.run/1

When I remove the :gettext entry from mix.exs {:gettext, "~> 0.18"},
the server doesnt launch and I get the error:

** (Mix) The task "compile.gettext" could not be found. Did you mean "compile.leex"?

I have tried this on many new phoenix apps but this behavior persists.

Update - I built a new app with the --no-gettext flag and this resolved the warning.

Hi,

you shouldn’t remove the dependency gettext, only removing the atom :gettext from the line

 compilers: [..., :gettext, ...] ++ Mix.compilers(),

That’s all.

2 Likes

Thanks