Phoenix: Funky reload behavior with Atom

So this is an issue with the file watcher in brunch, not elixir, huge difference there. ^.^;

Does the same issue happen when you do not have the phoenix server running but run the brunch watcher directly from the commandline?

As an example, I just opened a page in the browser, re-enabled github package, then focused on the ā€œApp.vueā€ tab in Atom. Hereā€™s what logs:

13:38:51.301 [debug] Live reload: priv/static/js/app.js
13:38:51.339 request_id=8hvt6ajmi249sk581cpkibjufaoe5dpr [info] GET /
13:38:51.339 request_id=8hvt6ajmi249sk581cpkibjufaoe5dpr [debug] Processing by Setlister.PageController.home/2
  Parameters: %{}
  Pipelines: [:browser, :browser_auth]
13:38:51.339 request_id=8hvt6ajmi249sk581cpkibjufaoe5dpr [info] x-forwarded-for ip:  for path /```

Yeah, thatā€™d definitely brunch.

Hmm, you do only have one instance of brunch (node.js) running if you check the process list of your system? Node does not always shut down cleanly and can become a zombie Iā€™ve noticed, and I wonder if thatā€™d cause them to conflict or soā€¦

Otherwise Iā€™d still try running brunchā€™s watch straight and see if can duplicate the problem then too.

EDIT: And of course watch the filesystem with another file watch without brunch running and see what events happen.

I ran brunch from the command line and same thing (this is from focusing on these tabs, and only for files that have unstaged changes.):

13:49:59 - info: compiled main.styl and 4 cached files into app.css in 195 ms
13:50:13 - info: compiled App.vue and 320 cached files into app.js in 477 ms
13:50:27 - info: compiled index.js and 320 cached files into app.js in 468 ms```

[quote="OvermindDL1, post:23, topic:12208"]
Hmm, you do only have one instance of brunch (node.js) running
[/quote]

So, in Activity Monitor, there are two Processes named `node`. Bear with me, I'm a newb at this system-related troubleshooting and monitoring.

That might be fine, unless youā€™ve stopped brunch. If youā€™ve stopped brunch do they all vanish? If not then whatever remains, kill it.

Otherwise next, time to startup a file watcher and log out all events that happen on, say, App.vue. :slight_smile:

Ok yeah, when I stop brunch then they both go away, and when I restart brunch watch they both come back.

Iā€™ll have to install fswatch tomorrow to investigate further. Iā€™m definitely super curious as to what is causing the behavior.

Thanks for all the input. :slight_smile:

Iā€™ve never used fswatch myself, only inotify-tools. ^.^;

Itā€™s a fascinating issue, Iā€™m not experiencing it on either windows or linux and I have a very similar setup of atom, so Iā€™m quite curious as to the problem. :slight_smile:

Well I may need to screenshare/phone with you tomorrow so you can ā€œdriveā€. Iā€™m sure the answer would be quicker that way! :wink: Stay tunedā€¦

Lol, well this forum has instant updates if the page remains loaded. ^.^

1 Like

If you do switch, be sure to install the excellent Elixir LS extension (GitHub - JakeBecker/vscode-elixir-ls: Elixir language support and debugger for VS Code, powered by ElixirLS. & vscode-elixir - Visual Studio Marketplace) for the live dialyzing and syntax checking experience you probably got used to with Atom (assuming you were already running the LS version in Atom). Itā€™s had a noticeable effect on my development time and efficiency.

1 Like