So I’m having some trouble. Recently my phoenix code stopped reloading, when I would make a change to backend code. So I’ve been having to flip back a forth killing the server and reloading after every change. I’m currently using Vim and Ale for linting, I read a github issue that said this was an issue a couple years ago, not sure if its still an issue but It does go away if I switch to emacs or atom or another editor so it makes me think its most likely the same issue.
I’d like to keep using vim since most of my muscle memory is there, anyone have any work arounds or solutions for this? Any help would be appreciated.
Deactivate compile on save or any plugin that does it to lint. Or if you are able to, change them to use different folders than the project folder to temporary save, compile and lint.
You could tell vim to use an :editorMIX_ENV which is equal to :dev but does end up in ./_build/editor/ instead.
Those are the workarounds that I’m aware of. You can use those workarounds for any editor-plugin that compiles on save.
Thanks, not sure how to do that for Ale. I did confirm it is Ale doing it. I just removed it and the issue cleared itself up. Once I find the settings or another solution I’ll post it here.
Is credo linting working for you with Ale? for the last week it has stopped working, and it doesn’t show any credo issues anymore, and I was wondering if the same was happening to you…
Nope credo isn’t working either. I think it’s related. Because Phoenix doesn’t seem to think the file has changed when I save from Vim. I can live with out credo but restarting phx.server every few minutes is super annoying.
@NobbZ yes it does. Why would setting MIX_ENV=edit fix the issue?
Because you then use a different MIX_ENV, which compiles to ,/_build/edit instead of ./_build/dev, therefore Phoenix.CodeReload can actually compile stuff and realize it changed for dev as well.
Makes sense. I know I can’t set that in my .zshrc since mix phx.server would pick it up and cause the same issue right? This depends on mix phx.server starting in MIX_ENV=dev and the editor starting it in MIX_ENV=edit right?
My Operating System in mac os and I am trying to use neovim…Need help to make recompile and neomake work together. Could you point my to any good blog post or article. I tried “http://www.smoothterminal.com/articles/neovim-for-elixir” post. but unable to get things work
In my opinion, the easiest way is to throw away the auto-recompile-and-reload-stuff of phoenix and do a more strict TDD approach, after tests pass go into a design phase, restarting phoenix as necessary.
At the end of a day/feature do some manual testing/playing around.