Closed DavidVII closed 6 years ago
@DavidVII sometimes people report issues once they enabled certain plugins in their editor, that try to automatically recompile the code. Then your editor ends-up racing with the Phoenix process. So I would start by stripping plugins or starting neovim in a "blank mode" and see if you can still reproduce it.
I'm unsure about the vim extensions, but at least in emacs and atom I can configure what mix environment it should compile in (it compiles so it can get error messages and so forth for display), and I use test
for that, which will not conflict with phoenix running in the default 'dev' mode anyway. :-)
@josevalim thanks for responding.
I had tried running neovim without an init file so there weren’t any plugins loaded. The problem unfortunately continued.
Perhaps this is an issue with the inotify-tools, but I’m not sure.
As a side note, the thing that finally switched me from a lifelong vim/neovim user to emacs was the SpaceMacs plugin set for emacs, which has quite an interesting vim-like mode (evil
mode when it asks upon first-time startup), and it works very well with elixir (set MIX_ENV=test
before running emacs), maybe give it a try? :-)
@DavidVII sorry for the delay, does the issue still exists? Does it happen if you use another editor?
@josevalim no problem at all.
Yes, this is still happening, but I think it may have something to do with neovim or possibly webpack. At some point, I was able to replicate this issue with a newly created phx app and neovim, but now I haven't been able to replicate it with a new app with just vim.
The issue does happen on an existing codebase that is running webpack. Not really sure what the deal is and honestly, I'm not sure I know where to look. I'm happy to test different things out if you have any ideas.
This does not happen in any other editor. I've only seen this happen in vim and neovim.
@DavidVII if it only happens in neovim then it definitely feels like something is triggering the reload or messing up with file system, although I have no idea what it may be. I will leave it open in case somebody else has a clue or has the same issue. Thanks for the reply!
@josevalim it happens in regular vim as well. Also, it only happens on Ubuntu and not on MacOS. Feels like an odd issue and agree that it sounds like a file system thing. It's not a huge issue (for me at least) since a simple refresh gets me back on track, but it doesn't seem like others are experiencing this.
Cheers!
This seems strange to me, but it appears that saving a template file using NeoVim causes the app to throw a
Phoenix.Template.UndefinedError
exception. I make the exact same changes using VSCode or a plain text editor and the live reload functionality works as expected.I installed the inotify tools as mentioned in the installation guides and ran neovim without an init.vim file as to not use any config or plugins.
Here are the steps I took:
I add the word
Hello
right under the openingbody
tag and hit:w
in neovim.Browser refreshes in the background with this error.
If I manually refresh the page, it renders with my added word in place.
I'm using