Every time I make changes to any file in Phoenix 1.7.6, I’m prompted to restart the server.
However, even though I’m not modifying the config/dev.exs or config/config.exs files, the error message indicates that changes were made to these files.
Error Logs:
** (RuntimeError) could not compile application: karma_axis_admin.
You must restart your server after changing the following files:
* config/dev.exs
* config/config.exs
Hey @sanjaykumarsharma that is indeed weird. I would start by simply doing an rm -rf deps _build and then re-fetching your dependencies and recompiling. If the issue persists I would try to push up a project to github that demonstrates the issue.
the editor and the terminal were using different version of elixir. I installed multiple version of elixir by using different package managers:
/usr/local/bin/elixir installed by Homebrew (it is a package manager on macOS)
/etc/profiles/per-user/<user>/bin/elixir installed by Nix (you can think it as a package manager)
the editor were using /usr/local/bin/elixir to format the code with mix format(which triggers the compilation)
the terminal were using /etc/profiles/per-user/<user>/bin/elixir to run the Phoenix server (whose livereload feature in dev mode triggers the compilation, too)
Step 2 and step 3 keep compiling the already compiled code, resulting in an endless loop. Maybe, you are in this situation, too.
One possible approach to inspect this problem: When this problem is reproduced, check the process tree to see if there are multiple Elixir related processes running. For example:
$ ps aux | grep -i elixir
If you’re willing, you can paste the execution result here.