Closed tpitale closed 7 years ago
Phoenix Walkthrough does say there isn't much point to dev
mode with Phoenix as it loses all the interactive features.
So, I guess the question is, should the dev environment included in the release.init
rel/config.exs
file have a note that it should be removed when using Phoenix.
Feel free to close this issue if this doesn't make sense.
Yeah we should add a note like that both in the docs and probably directly in the release config file as a last resort. That said, I wonder if it might be possible to detect if the current environment has the code reloader enabled, and fail the release build automatically because of that, I'll have to look into it, since that would provide a better failsafe.
Dev mode in Distillery is a way to run the release version of your application while being able to easily make changes and recompile without having to build the release again, you just restart it, making for quicker experimentation -- but it doesn't change the fundamental restrictions releases have in place, such as not being able to use Mix, and things which rely on Mix or the Mix project definition not working properly (such as the Phoenix code reloader).
I'm going to open an issue on Phoenix to see if it is possible to disable CodeReloader/other mix-related code.
For future folks who may find this post, you can disable CodeReloader by setting code_reloader: false
in config/dev.exs
and commenting out the code reloading section in lib/{yourapp}/endpoint.ex
. https://stackoverflow.com/questions/45696663/possible-to-disable-codereloader-in-phoenix/45696773#45696773
I've added a note to the initial release config file in the latest release of Distillery, so that should help as well.
Steps to reproduce
mix deps.get
MIX_ENV=dev mix do clean --all, compile, release
_build/dev/rel/advocate_bridge/bin/advocate_bridge console
Verbose Logs
Description of issue
I'm not sure if dev_mode is expected to work with a Phoenix app. It seems to be upset with Mix.Config from Phoenix.CodeReloader.
Is this not what dev_mode config is intended to do (include things like Mix)? Or is there some accepted way to disable phoenix attempting to do code reloading at all (which I obviously don't need with a release).
If not, should dev_mode be documented somewhere to indicate it's purpose, as it is included in the
release.init
task.Mac OS 10.12.4 Erlang/OTP 20 Elixir 1.5.1
rel/config.exs
, as it is often my first troubleshooting question, and you'll save us both time :)dev_mode
documentation does explain that the code is symlink'd, but says nothing about Mix or using Phoenix.