4

The CodeReloader (in dev mode) is using Mix.Config. This fails when using distillery releases in dev_mode because mix is not available in releases.

Is it possible to completely disable CodeReloader in a Phoenix app, such that my app will not fail to start in a dev_mode release?

Tony Pitale
  • 1,192
  • 2
  • 11
  • 23

1 Answers1

5

In your applications /config/dev.exs you will have something along the lines of

config :my_app_web, MyApp.Web.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("../assets", __DIR__)]]

Just change code_reloader: true to code_reloader: false. Or you could remove the following code from your MyApp.Endpoint

if code_reloading? do
  socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
  plug Phoenix.LiveReloader
  plug Phoenix.CodeReloader
end
Justin Wood
  • 9,941
  • 2
  • 33
  • 46