phoenixframework / phoenix

Peace of mind from prototype to production
https://www.phoenixframework.org
MIT License
21.42k stars 2.87k forks source link

Phoenix.CodeReloader won't compile in Phoenix 1.7.8 #5598

Closed dfalling closed 1 year ago

dfalling commented 1 year ago

Environment

Elixir 1.15.4 (compiled with Erlang/OTP 24)

* Phoenix version (mix deps): `1.7.8`
* Operating system: `macOS Sonomoa (14.0 (23A344))`

### Actual behavior

Phoenix fails to start from `mix phx.server` after updating to Phoenix 1.7.8

== Compilation error in file lib/ido_web/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.4) 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.4) 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/ido_web/endpoint.ex:1: IdoWeb.Endpoint (module)


### Expected behavior

It should start fine, as it did in Phoenix 1.7.7

I have a standard Endpoint.ex in my application. I don't think I've changed the CodeLoader code at all:

```elixir
  # Code reloading can be explicitly enabled under the
  # :code_reloader configuration of your endpoint.
  if code_reloading? do
    socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
    plug Phoenix.LiveReloader
    plug Phoenix.CodeReloader
    plug Phoenix.Ecto.CheckRepoStatus, otp_app: :ido
  end
chrismccord commented 1 year ago

As a sanity check, can you mix clean and retry?

dfalling commented 1 year ago

Ah I forgot to try that before, but that doesn't fix it. Here are all my deps.

mix deps.outdated ``` Dependency Current Latest Status absinthe 1.7.5 1.7.5 Up-to-date absinthe_plug 1.5.8 1.5.8 Up-to-date bcrypt_elixir 3.1.0 3.1.0 Up-to-date bodyguard 2.4.2 2.4.2 Up-to-date castore 1.0.4 1.0.4 Up-to-date cors_plug 3.0.3 3.0.3 Up-to-date credo 1.7.1 1.7.1 Up-to-date dataloader 2.0.0 2.0.0 Up-to-date debounce 1.0.0 1.0.0 Up-to-date dialyxir 1.4.1 1.4.1 Up-to-date earmark 1.4.46 1.4.46 Up-to-date ecto_sql 3.10.2 3.10.2 Up-to-date enum_type 1.1.3 1.1.3 Up-to-date esbuild 0.7.1 0.7.1 Up-to-date ex_aws 2.5.0 2.5.0 Up-to-date ex_aws_s3 2.5.0 2.5.0 Up-to-date ex_machina 2.7.0 2.7.0 Up-to-date floki 0.34.3 0.34.3 Up-to-date geo_postgis 3.5.0 3.5.0 Up-to-date gettext 0.23.1 0.23.1 Up-to-date google_maps 0.11.0 0.11.0 Up-to-date hackney 1.20.0 1.20.0 Up-to-date hammer 6.1.0 6.1.0 Up-to-date hammox 0.7.0 0.7.0 Up-to-date honeybadger 0.20.0 0.20.0 Up-to-date html_sanitize_ex 1.4.3 1.4.3 Up-to-date httpoison 2.1.0 2.1.0 Up-to-date jason 1.4.1 1.4.1 Up-to-date logger_papertrail_backend 1.1.0 1.1.0 Up-to-date mint 1.5.1 1.5.1 Up-to-date mix_audit 2.1.1 2.1.1 Up-to-date mix_test_watch 1.1.1 1.1.1 Up-to-date open_cagex 0.1.4 0.1.4 Up-to-date openai 0.5.4 0.5.4 Up-to-date phoenix 1.7.8 1.7.8 Up-to-date phoenix_ecto 4.4.2 4.4.2 Up-to-date phoenix_html 3.3.3 3.3.3 Up-to-date phoenix_live_dashboard 0.8.2 0.8.2 Up-to-date phoenix_live_favicon 0.2.0 0.2.0 Up-to-date phoenix_live_reload 1.4.1 1.4.1 Up-to-date phoenix_live_view 0.20.1 0.20.1 Up-to-date phoenix_pubsub 2.1.3 2.1.3 Up-to-date plug_cowboy 2.6.1 2.6.1 Up-to-date poison 5.0.0 5.0.0 Up-to-date postgrex 0.17.3 0.17.3 Up-to-date sobelow 0.13.0 0.13.0 Up-to-date ssl_verify_fun 1.1.7 1.1.7 Up-to-date styler 0.9.6 0.9.6 Up-to-date sweet_xml 0.7.4 0.7.4 Up-to-date swoosh 1.12.0 1.12.0 Up-to-date tailwind 0.2.1 0.2.1 Up-to-date telemetry_metrics 0.6.1 0.6.1 Up-to-date telemetry_poller 1.0.0 1.0.0 Up-to-date tesla 1.7.0 1.7.0 Up-to-date trailing_format_plug 0.0.7 0.0.7 Up-to-date typed_ecto_schema 0.4.1 0.4.1 Up-to-date typed_struct 0.3.0 0.3.0 Up-to-date tz 0.26.2 0.26.2 Up-to-date tz_extra 0.26.0 0.26.0 Up-to-date Run `mix hex.outdated APP` to see requirements for a specific dependency. ```
chrismccord commented 1 year ago

Can you try removing _build entirely? I cannot reproduce this

dfalling commented 1 year ago

No-go on that either. I also deleted my deps foldere.

Here's the full output of my mix phx.server. There are some deprecation warnings from dependencies but nothing that sticks out to me:

mix phx.server ``` ==> typed_struct Compiling 2 files (.ex) Generated typed_struct app ==> file_system Compiling 7 files (.ex) Generated file_system app ===> Analyzing applications... ===> Compiling poolboy ==> decimal Compiling 4 files (.ex) Generated decimal app ==> combine Compiling 6 files (.ex) Generated combine app ==> enum_type Compiling 1 file (.ex) Generated enum_type app ==> debounce Compiling 2 files (.ex) Generated debounce app ==> mime Compiling 1 file (.ex) Generated mime app ==> nimble_parsec Compiling 4 files (.ex) Generated nimble_parsec app ===> Analyzing applications... ===> Compiling unicode_util_compat ===> Analyzing applications... ===> Compiling idna ==> bunt Compiling 2 files (.ex) Generated bunt app ===> Analyzing applications... ===> Compiling telemetry ==> telemetry_metrics Compiling 7 files (.ex) Generated telemetry_metrics app ===> Analyzing applications... ===> Compiling telemetry_poller ==> jason Compiling 10 files (.ex) Generated jason app ==> sobelow Compiling 51 files (.ex) Generated sobelow app ==> poison Compiling 4 files (.ex) warning: use Bitwise is deprecated. import Bitwise instead lib/poison/parser.ex:65: Poison.Parser (module) warning: use Bitwise is deprecated. import Bitwise instead lib/poison/encoder.ex:112: Poison.Encoder.BitString (module) Compiling lib/poison/parser.ex (it's taking more than 10s) Generated poison app ==> comeonin Compiling 3 files (.ex) Generated comeonin app ==> db_connection Compiling 15 files (.ex) Generated db_connection app ==> expo Compiling 2 files (.erl) Compiling 21 files (.ex) Generated expo app ==> phoenix_pubsub Compiling 11 files (.ex) Generated phoenix_pubsub app ==> mix_test_watch Compiling 8 files (.ex) Generated mix_test_watch app ==> plug_crypto Compiling 5 files (.ex) Generated plug_crypto app ==> hpax Compiling 4 files (.ex) Generated hpax app ===> Analyzing applications... ===> Compiling yamerl ==> yaml_elixir Compiling 6 files (.ex) Generated yaml_elixir app ==> mix_audit Compiling 16 files (.ex) Generated mix_audit app ===> Analyzing applications... ===> Compiling mimerl ==> gettext Compiling 17 files (.ex) Generated gettext app ==> logger_papertrail_backend Compiling 7 files (.ex) warning: Supervisor.Spec.worker/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead lib/logger_papertrail_backend.ex:8: LoggerPapertrailBackend.start/2 Generated logger_papertrail_backend app ===> Analyzing applications... ===> Compiling ranch ==> ssl_verify_fun Compiling 7 files (.erl) Generated ssl_verify_fun app ===> Analyzing applications... ===> Compiling certifi ==> credo Compiling 251 files (.ex) Generated credo app ==> ecto Compiling 56 files (.ex) warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/ecto/repo/preloader.ex:208: Ecto.Repo.Preloader.fetch_ids/4 warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/ecto/changeset/relation.ex:474: Ecto.Changeset.Relation.process_current/3 warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/ecto/changeset.ex:3156: Ecto.Changeset.optimistic_lock/3 Generated ecto app ==> dataloader Compiling 4 files (.ex) Generated dataloader app ==> absinthe Compiling 1 file (.erl) Compiling 260 files (.ex) Generated absinthe app ==> typed_ecto_schema Compiling 4 files (.ex) Generated typed_ecto_schema app ==> plug Compiling 1 file (.erl) Compiling 40 files (.ex) Generated plug app ==> absinthe_plug Compiling 18 files (.ex) warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead lib/absinthe/plug/graphiql/assets.ex:5: Absinthe.Plug.GraphiQL.Assets (module) Generated absinthe_plug app ==> phoenix_html Compiling 9 files (.ex) Generated phoenix_html app ==> phoenix_template Compiling 4 files (.ex) Generated phoenix_template app ==> trailing_format_plug Compiling 1 file (.ex) Generated trailing_format_plug app ==> postgrex Compiling 68 files (.ex) Generated postgrex app ==> geo Compiling 26 files (.ex) Generated geo app ==> geo_postgis Compiling 4 files (.ex) Generated geo_postgis app ==> hammer Compiling 6 files (.ex) Generated hammer app ==> styler Compiling 8 files (.ex) Generated styler app ===> Analyzing applications... ===> Compiling parse_trans ==> erlex Compiling 2 files (.erl) Compiling 1 file (.ex) Generated erlex app ==> dialyxir Compiling 66 files (.ex) Generated dialyxir app ==> ecto_sql Compiling 25 files (.ex) warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/ecto/migrator.ex:271: Ecto.Migrator.up/4 Generated ecto_sql app ===> Analyzing applications... ===> Compiling metrics ===> Analyzing applications... ===> Compiling hackney ==> tzdata Compiling 17 files (.ex) Generated tzdata app ==> timex Compiling 62 files (.ex) Generated timex app ==> icalendar Compiling 10 files (.ex) Generated icalendar app ==> bodyguard Compiling 9 files (.ex) Generated bodyguard app ==> cors_plug Compiling 1 file (.ex) Generated cors_plug app ==> castore Compiling 1 file (.ex) Generated castore app ==> esbuild Compiling 3 files (.ex) warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/esbuild.ex:69: Esbuild.start/2 warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/esbuild.ex:83: Esbuild.start/2 Generated esbuild app ==> mint Compiling 1 file (.erl) Compiling 19 files (.ex) Generated mint app ==> tesla Compiling 34 files (.ex) Generated tesla app ==> tz Compiling 16 files (.ex) Generated tz app ==> tz_extra Compiling 7 files (.ex) Generated tz_extra app ==> tailwind Compiling 3 files (.ex) warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/tailwind.ex:72: Tailwind.start/2 warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/tailwind.ex:86: Tailwind.start/2 Generated tailwind app ==> elixir_make Compiling 6 files (.ex) Generated elixir_make app ==> bcrypt_elixir mkdir -p "/Users/dfalling/Code/ido_api/_build/dev/lib/bcrypt_elixir/priv" cc -g -O3 -Wall -Wno-format-truncation -I"/Users/dfalling/.asdf/installs/erlang/26.0.2/erts-14.0.2/include" -Ic_src -fPIC -shared -dynamiclib -undefined dynamic_lookup c_src/bcrypt_nif.c c_src/blowfish.c -o "/Users/dfalling/Code/ido_api/_build/dev/lib/bcrypt_elixir/priv/bcrypt_nif.so" warning: unknown warning option '-Wno-format-truncation' [-Wunknown-warning-option] 1 warning generated. warning: unknown warning option '-Wno-format-truncation' [-Wunknown-warning-option] 1 warning generated. Compiling 3 files (.ex) Generated bcrypt_elixir app ==> earmark Compiling 3 files (.erl) Compiling 61 files (.ex) Generated earmark app ==> websock Compiling 1 file (.ex) Generated websock app ==> sweet_xml Compiling 2 files (.ex) Generated sweet_xml app ==> ex_aws Compiling 27 files (.ex) Generated ex_aws app ==> ex_aws_s3 Compiling 7 files (.ex) Generated ex_aws_s3 app ==> httpoison Compiling 3 files (.ex) Generated httpoison app ==> open_cagex Compiling 5 files (.ex) warning: redefining @doc attribute previously set at line 17. Please remove the duplicate docs. If instead you want to override a previously defined @doc, attach the @doc attribute to a function head (the function signature not followed by any do-block). For example: @doc """ new docs """ def handle(...) lib/open_cagex/response.ex:25: OpenCagex.Response.handle/1 warning: redefining @doc attribute previously set at line 17. Please remove the duplicate docs. If instead you want to override a previously defined @doc, attach the @doc attribute to a function head (the function signature not followed by any do-block). For example: @doc """ new docs """ def handle(...) lib/open_cagex/response.ex:32: OpenCagex.Response.handle/1 warning: variable "key" is unused (if the variable is not meant to be used, prefix it with an underscore) lib/open_cagex/parser.ex:23: OpenCagex.Parser.get_key/2 Generated open_cagex app ==> openai Compiling 17 files (.ex) Generated openai app ==> google_maps Compiling 3 files (.ex) Generated google_maps app ===> Analyzing applications... ===> Compiling mochiweb ==> html_sanitize_ex Compiling 11 files (.ex) Generated html_sanitize_ex app ===> Analyzing applications... ===> Compiling cowlib ===> Analyzing applications... ===> Compiling cowboy ===> Analyzing applications... ===> Compiling cowboy_telemetry ==> plug_cowboy Compiling 5 files (.ex) warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/plug/cowboy.ex:352: Plug.Cowboy.to_args/5 Generated plug_cowboy app ==> swoosh Compiling 45 files (.ex) Generated swoosh app ==> websock_adapter Compiling 2 files (.ex) Generated websock_adapter app ==> phoenix Compiling 71 files (.ex) Generated phoenix app ==> honeybadger Compiling 22 files (.ex) warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/honeybadger/client.ex:66: Honeybadger.Client.send_notice/1 warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/honeybadger/client.ex:140: Honeybadger.Client.handle_cast/2 warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/honeybadger/client.ex:143: Honeybadger.Client.handle_cast/2 warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/honeybadger/client.ex:170: Honeybadger.Client.post_notice/4 warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/honeybadger/client.ex:174: Honeybadger.Client.post_notice/4 warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/honeybadger/client.ex:177: Honeybadger.Client.post_notice/4 Generated honeybadger app ==> phoenix_live_reload Compiling 4 files (.ex) warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead lib/phoenix_live_reload/application.ex:32: Phoenix.LiveReloader.Application.start_link/0 Generated phoenix_live_reload app ==> phoenix_live_view Compiling 39 files (.ex) Generated phoenix_live_view app ==> phoenix_live_dashboard Compiling 36 files (.ex) Generated phoenix_live_dashboard app ==> phoenix_live_head Compiling 1 file (.ex) Generated phoenix_live_head app ==> phoenix_live_favicon Compiling 1 file (.ex) Generated phoenix_live_favicon app ==> phoenix_ecto Compiling 7 files (.ex) Generated phoenix_ecto app ==> ido Compiling 135 files (.ex) == Compilation error in file lib/ido_web/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.4) 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.4) 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/ido_web/endpoint.ex:1: IdoWeb.Endpoint (module) ```
GabrielValeRios commented 1 year ago

I also had this problem with the following error:

** (ArgumentError) cannot escape #Function<0.108744951/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.14.2 (compiled with Erlang/OTP 24)


- Plugin used in `code_reloading?`

plug Phoenix.CodeReloader


- O.S

Ubuntu 22.04.1 LTS



Downgrading phoenix from `1.7.8 -> 1.7.7` solved the issue
happyraul commented 1 year ago

I'm also experiencing the error, on a fresh umbrella project. I tried 1.7.6, 1.7.7, 1.7.8 and all have the same result.

These are the commands I ran:


$ mix new --umbrella happyraul
$ cd happyraul/apps
$ mix phx.new.web web
$ cd web
$ iex -S mix phx.server
Compiling 12 files (.ex)

== Compilation error in file lib/web/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/web/endpoint.ex:1: Web.Endpoint (module)
PatrickLTew commented 1 year ago

Started receiving this problem this afternoon, too. Same error message. But - changing to Phoenix 1.7.7 unfortunately hasn't helped (in fact, it started under 1.7.7 today (which I've been using for a long while with no issues), so I upgraded to 1.7.8 in case that helped - it didn't. I've downgraded to 1.7.7 just in case, but of course to no avail). Moreover, I don't recall changing anything about my setup before the issue started - so, I'm guessing something changed (perhaps today) on some package's end, and hex now pulls that latest version, which has the issue? Only commenting out the plug in my Endpoint 'solves' it:

#plug Phoenix.CodeReloader

But obviously this is problematic.

Note - it seems to be only happening (as far as I can tell) for me under a certain project structure. For historical reasons, the way I build my apps is:


$ 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
$ cd ../
$ mix deps.get
$ mix compile (or, mix phx.server - the error occurs whenever it tries to compile)

I recognise that's less conventional than, say, mix phx.new app_name --umbrella, but it's the structure I've used just fine for ages, until... literally this afternoon.

But when I now build little test apps in other ways:

$ mix phx.new app_name --umbrella
$ mix phx.new app_name

this issue isn't present, and all is well? Will be keen to see what's caused this conundrum and hopefully what solves it.

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)

OS:

Windows 10 Pro
PatrickLTew commented 1 year ago

I'm also experiencing the error, on a fresh umbrella project. I tried 1.7.6, 1.7.7, 1.7.8 and all have the same result.

These are the commands I ran:

$ mix new --umbrella happyraul
$ cd happyraul/apps
$ mix phx.new.web web
$ cd web
$ iex -S mix phx.server
Compiling 12 files (.ex)

== Compilation error in file lib/web/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/web/endpoint.ex:1: Web.Endpoint (module)

When I build my apps with the same project structure as you (and that same sequence of mix commands thus), I get the error - but when I create my project with one of the other standard structures, like doing $ mix phx.new app_name --umbrella or $ mix phx.new app_name, everything works? Have you experienced this? Thanks.

happyraul commented 1 year ago

@PatrickLTew Yes, using mix phx.new app_name --umbrella or mix phx.new app_name works for me (compiles without error) as well.

canelle20214 commented 1 year ago

Same problem here:

== Compilation error in file lib/my_app_web/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/my_app_web/endpoint.ex:1: MyAppWeb.Endpoint (module)

Phoenix version:

  phoenix 1.7.8

Elixir and OTP version (with asdf current):

elixir          1.15.6-otp-26
erlang          26.1.1 

Update: 2 solutions worked well: Downgrade Phoenix to 1.7.7 or keep Phoenix to 1.7.8 and adding :reloader keyword to plug configuration inside endpoint.ex:

    plug Phoenix.CodeReloader, reloader: &Phoenix.CodeReloader.reload/1
josevalim commented 1 year ago

Fixed in main by 7b8575d6158ec1d2fae2bcd8049814a6f88c3bee, sorry about that.

josevalim commented 1 year ago

Please confirm it works for you and we will ship a new release. :)

canelle20214 commented 1 year ago

All fixed, thank you !

PatrickLTew commented 1 year ago

@PatrickLTew Yes, using mix phx.new app_name --umbrella or mix phx.new app_name works for me (compiles without error) as well.

Ok great, thanks for confirming.

PatrickLTew commented 1 year ago

Please confirm it works for you and we will ship a new release. :)

Awesome, thanks! :) In case anyone else is still stuck on this, you have to (for now, until the Phoenix 1.7.9 Hex package is eventually released) reference GitHub as the source of your Phoenix dependency. So, in your mix.exs replace the default:

{:phoenix, "~> 1.7"},

with

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

At least, that's what I'm having to do.

Thanks again for the fix

03juan commented 1 year ago
{:phoenix, github: "phoenixframework/phoenix", branch: "main", override: true},

I prefer to pin the github dependency to a particular commit, in case newer commits to the branch introduce unintended consequences to the app.

{:phoenix, github: "phoenixframework/phoenix", ref: "7b8575d6158ec1d2fae2bcd8049814a6f88c3bee", override: true},