LionelHutz

LionelHutz

Without (knowingly) changing anything in my workflow, my Elixir/Erlang/Phoenix versions, or any dependencies etc, I suddenly started getting this error when trying to compile my new umbrella project:

== Compilation error in file lib/phxapp/endpoint.ex ==
** (ArgumentError) cannot escape #Function<0.12031047/1 in Phoenix.CodeReloader.init/1>. The supported values are: lists, tuples, maps, atoms, numbers, bitstrings, PIDs and remote functions in the format &Mod.fun/arity
    (elixir 1.15.6) src/elixir_quote.erl:505: :elixir_quote.argument_error/1
    (plug 1.15.1) lib/plug/builder.ex:344: Plug.Builder.init_module_plug/4
    (plug 1.15.1) lib/plug/builder.ex:322: anonymous fn/5 in Plug.Builder.compile/3
    (elixir 1.15.6) lib/enum.ex:2510: Enum."-reduce/3-lists^foldl/2-0-"/3
    (plug 1.15.1) lib/plug/builder.ex:320: Plug.Builder.compile/3
    (plug 1.15.1) expanding macro: Plug.Builder.__before_compile__/1
    lib/phxapp/endpoint.ex:1: Phxapp.Endpoint (module)

(Note - I mentioned this error has started today: it also seems to be affecting only projects built today, as earlier, almost identical projects recompile just fine.)

I’m using Phoenix 1.7.7, and have been for a while. In fact, as said, my process has been rock solid for several weeks - right until this error started appearing.

I tried upgrading to 1.7.8, but that did nothing. I went back to 1.7.7, and it still persists. Only commenting out the invocation of the plug in question (in my endpoint.ex) ‘solves’ it:

 if code_reloading? do
    socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
    plug Phoenix.LiveReloader
    #plug Phoenix.CodeReloader
  end

However - I have noticed that the error seems to occur under only one project structure (of those I’ve tried). I usually build my apps via:

$ mix new app_name --umbrella
$ cd app_name/apps
$ mix phx.new.web web_app_name --no-ecto
$ mix phx.new.ecto ecto_app_name

This structure has served me well for months, right up until today. But now I get the compile error. However, if I do something like:

$ mix phx.new app_name --umbrella

or

$ mix phx.new app_name

etc, then everything works just fine? I see in the changelogs of the Phoenix repo that some changes were indeed made to Phoenix.CodeReader the day before/day of when this error started appearing - perhaps they’re the root of it?:

https://github.com/phoenixframework/phoenix/blob/main/CHANGELOG.md

Further, it seems like some other people are facing it, too:

https://github.com/phoenixframework/phoenix/issues/5598

Anyone else have any thoughts/experience with this error?

Thanks

Showing Posts 1 to 9

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hi @LionelHutz first as a basic sanity check can you rm -rf _build and see if the issue persists? Beyond that, what version of Elixir are you using?

LionelHutz

LionelHutz OP

Thanks for the reply, @benwilson512 - unfortunately removing _build didn’t change things. As for my Elixir version:

Erlang/OTP 26 [erts-14.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.15.6 (compiled with Erlang/OTP 26)

Happy to try any other tips or, though.

Thanks

josevalim

josevalim

Creator of Elixir

@LionelHutz it is a bug, I will fix it. :slight_smile:

josevalim

josevalim

Creator of Elixir

Fixed in main.

LionelHutz

LionelHutz OP

Great, thanks so much! Really appreciate it.

However, when I leave the reference to the Phoenix package in my deps as the default-generated:

{:phoenix, "~> 1.7.8"}

the error still appears. But if I replace it with the more specific:

{:phoenix, github: "phoenixframework/phoenix", branch: "main", override: true}

the error indeed now disappears. I’m guessing then that the update on GitHub hasn’t been propagated to Hex yet, and I should just wait for that? Or is there something else I should do to make sure the default package-reference syntax enables the fix?

Thanks!

LostKobrakai

LostKobrakai

The fix hasn’t been made part of a versioned release yet. There aren’t new releases being made for individual bug fixes. 1.7.9 will eventually include it.

LionelHutz

LionelHutz OP

Ok great, thanks!

chrismccord

chrismccord

Creator of Phoenix

Fix was released with 1.7.9

LionelHutz

LionelHutz OP

Perfect, thanks

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews