Phoenix 1.3 not autoreload project when it changes

I have a phoenix 1.3 project in my pc (with ubuntu 17.04) and also in cloud9.(with ubuntu 14.04 LTS)
In cloud9 it works normally.
In my pc, after that i upgrade the project to phoenix 1.3 it not reload more automatically if i change the code.
I have to restart mix phx.server for view the changes.

What can be the problem?
How can i do to fix it?

Thanks

Are you changing .ex files or .exs?

Did you follow the upgrade guide? Or did you only upgrade the the Phoenix version number?

Are you executing a request to the Phoenix application? Because that is when the code reload should happen.

Do you have a MIX_ENV environment variable set? If so, what is it set to?

When something like this happened to me recently, I found the cause to be the syntax checker in my editor. It was compiling the files when I saved them, which updated the timestamp, which is what Phoenix reload logic uses to know whether to reload them in the active BEAM.

My solution so far, which I’m not entirely happy with, was to switch to a simpler syntax checker that I could configure to write to the /tmp directory. But first you should temporarily disable syntax checking completely just to see if that is the cause of your problem.

1 Like

Thanks, i fixed it with npm update

Uhh, that should have done nothing to change how phoenix recompiles stuff. Was it really phoenix not reloading or were you talking about CSS or javascript assets or other non-phoenix parts like that?

I have a similar problem. No autoreload with the latest version of Phoenix (I had to switch it off w earlier RCs because I don’t think the module was available)

Check list:

  1. patterns are updated and are OK:

    ~r{lib/hello/web/views/.(ex)$},
    ~r{lib/hello/web/templates/.
    (eex)$}

  2. I am editing and compiling directly on the same VM

  3. I call iex using

MIX_ENV=dev iex -S mix phx.server

just to be safe

  1. inotify-tools is installed

  2. i switched off editor elixir plugin, just-in-case

  3. code_reloader: true, in dev.exs

  4. I commented out ‘watchers’ line - assume it is just for JS etc.

  5. I just used nano on the VM, just to be sure nothing funny was going on…

  6. mix.exs has this line: {:phoenix_live_reload, “~> 1.0”, only: :dev},

Anything else I might have missed?

On (neo)vim with the neomake plugin, add these lines:

" When writing a buffer.
call neomake#configure#automake('w')
let g:neomake_elixir_enabled_makers = ['elixir', 'credo']

And everything works like a charm.