First, I'd like to say I'm impressed and hooked to both elixir and phoenix. I would love to, and plan to be, a productive member of both communities.
I was following the Views guide on the website until I reached the ErrorView section. It says that we should set debug_errors: false in order to see what page the application would serve in production.
However, I tried setting the value to false and back to true several times with no avail. Restarting the dev server didn't help either. It did work, however, when I toggled the code_reloader option a few times. It almost feels like debug_errors and code_reloader are related somehow.
I'm using Phoenix 1.1, Elixir 1.1.1.
I observed the same (or related) issue with Phoenix 1.2.0-rc.0, I guess.
After changing the dev.exs to switch off debug_errors and code_reloader, I need to change something in my endpoint.ex to trigger a compile. Otherwise the config change is not effective.
I'm experiencing the same issue on Phoenix 1.2.1 (Elixir 1.4.0 / Erlang 18.3). A clean and recompile fixes the issue, but it feels like this should be investigated or the documentation should be updated to indicate a recompile is required.
I cannot reproduce this. If I change the config/dev.exs file, the whole project is recompiled accordingly. Can someone please provide a step by step reproduction?
@josevalim I have a newer project which works as expected and the whole project is recompiled using:
However, with 1.2.1, if I change only the config value for debug_errors to true or false and save, the project is not recompiled. I must clean and recompile to change the state of debug_errors completely.
More background - the Phoenix app that is not recompiling is an umbrella app with the Phoenix app located under ./apps/myapp_web.
dev.exs
use Mix.Config
config :myapp_web, MyAppWeb.Endpoint,
http: [port: 4000],
debug_errors: true,
code_reloader: true,
check_origin: false,
watchers: [node: ["node_modules/brunch/bin/brunch", "watch", "--stdin",
cd: Path.expand("../", __DIR__)]]
# Watch static and templates for browser reloading.
config :myapp_web, MyAppWeb.Endpoint,
live_reload: [
patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},
~r{priv/gettext/.*(po)$},
~r{web/views/.*(ex)$},
~r{web/templates/.*(eex)$}
]
]
I can confirm this is still true as of 1.3rc1.
Must clean and recompile before changes to debug_errors take effect.
@seymores What Erlang/Elixir version are you using? And do you have Phoenix as an umbrella app?
I've positively reproduced the issue on 1.3rc1 as well as 1.2.1.
Environment:
Steps to reproduce:
mix phx.new new_phoenix --umbrella --no-ectocd new_phoenixmix phx.serverapps/new_phoenix_web/config/dev.exs and change debug_errors: true to debug_errors: falsemix phx.servermix phx.serverPage not found text.If we clean and recompile from the top level directory, the file change is reflected.
FWIW, this could be an issue with Elixir instead of Phoenix, mix compile does not pickup the config file changes under the umbrella app.
➜ new_phoenix_umbrella touch apps/new_phoenix/config/dev.exs
➜ new_phoenix_umbrella mix compile
➜ new_phoenix_umbrella touch apps/new_phoenix/config/config.exs
➜ new_phoenix_umbrella mix compile
➜ new_phoenix_umbrella touch apps/new_phoenix_web/config/dev.exs
➜ new_phoenix_umbrella mix compile
➜ new_phoenix_umbrella touch apps/new_phoenix_web/mix.exs
➜ new_phoenix_umbrella mix compile
==> new_phoenix_web
Compiling 11 files (.ex)
Generated new_phoenix_web app
I can confirm it still exists. I have to delete _build to get debug_errors: false taken into account in umbrella app. Simple restart doesn't help
Phoenix v1.3.0
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Elixir 1.5.1
I'm still having this problem as well when using a umbrella app.
• Elixir 1.6.2 (compiled with OTP 20)
• Phoenix v1.3.0
I had run mix compile --force to get the change to take hold. But other configs work when reloading the server, specifically the port config. When I change that one it takes hold on restart. 🤔
Yes, it is an issue with Elixir. It will be addressed once we solve https://github.com/elixir-lang/elixir/issues/6996.
Most helpful comment
Yes, it is an issue with Elixir. It will be addressed once we solve https://github.com/elixir-lang/elixir/issues/6996.