I’m a little confused wrt. how the hot code reloading works in Phoenix. Even though I have code_reloader: true, set in my dev.exs, I often find myself having to forcibly restart my Phoenix server (ie. Ctrl-C twice, then re-run mix phx.server) when editing files like router.ex to see an effect of my changes.
Is that expected behaviour, or is this indication of some kind of bug?
What does happen if you do recompile() in iex -S mix phx.server? If it results in :noop then you might have other processes compiling your code at the same time as phoenix. The code_reloader basically compares modification timestamps on source files as as well as compiled files and if they don’t match then it compiles and loads the new compiled file. If something else compiles files sooner then the code_reloader can’t detect the change anymore.
Ah, so I guess it could be because I’m using ElixirLS and Elixir Linter in VSCode, that are also compiling stuff. I guess I’ll try disabling them, see if that helps.
@LostKobrakai yeah, ElixirLinter is unmaintained, and now I think of it, I didn’t have problems before I installed that. I’ll try without it for a while to see if it reoccurs. Thanks for the pointers.