soundstruck
For some strange reason, when I switch tabs in Atom, or open a file in Atom, it’s causing Phoenix to re-compile assets and reload the page, even when there are no changes to those files.
For example:
click a .vue file tab in Atom:
17:19:37 - info: compiled myfile.vue and 320 cached files into app.js in 636 ms, and the page reloads.
click a .styl file tab in Atom:
17:20:27 - info: compiled myfile.styl and 4 cached files into app.css in 284 ms, and the page reloads.
This is happening without making any edits to those files. It’s not happening with .js files for some reason.
All I have to do is open the file in Atom, OR, click on one of the opened file’s tabs in Atom.
Can anyone who is using Atom confirm?
Me: MacOS, Atom version: 1.23.3
I’ve been using Atom and this was not happening before, so I’m not sure if an Atom update caused it, or if it’s anything that I’ve done. It’s certainly annoying!
Thanks in advance for any insight or suggestions.
p.s. This behavior is not happening in VS Code, so it does seem to be Atom related. I’m just not sure what the relationship between Atom/Phoenix could be to cause it, and I’m not sure where else to troubleshoot it.
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #elixirconf-us
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
tcollen
If you make a change to a file, but don’t save it, and then switch tabs, does it happen?
It kind of sounds like Atom is automatically saving/touching the file when you switch.
I’d definitely wouldn’t expect an editor to do that, though!
soundstruck
Thanks for the response, @tcollen.
It doesn’t happen if I make unsaved changes.
But as soon as I change focus to another tab, then switch focus back to that tab – live-reload recompiles and a new page refresh happens in the browser.
So it does seem like Atom is automatically touching or triggering a recompile when I focus the tab, but it’s not saving the file because otherwise I’d see those unsaved changes when the page reloads.
I just tried this all again in VS Code, opened files, switched tabs, etc., and I do not see any re-compiles.
Does this mean that this is some kind of a bug in Atom? Should I report it as such?
I hate to switch to using VS Code if I can help it (only because I’m comfortable and have all my plugins set up in Atom, so you know…change). But if I can’t get this figured out I may have to switch because I can’t work like this.
soundstruck
Ok, it appears this is somehow related to Git.
If I change focus to the tab of a file that has unstaged changes, then I get the reload behavior (for any type of file, .vue, .js, .css, etc.).
If I change focus to the tab of a file without any changes, nothing happens (expected behavior).
If I then stage all the changes, reload continues indefinitely until I commit the changes (and this behavior is also happening in VS Code).
Anyone understand that relationship and why this might be happening? Why is Phoenix being triggered in that way?
OvermindDL1
Uh, I’ve not noticed it happening with atom here, what git plugins do you have, or rather what it your complete plugin list?
soundstruck
Thanks for your reply.
The git functionality is baked into Atom…not using anything special. I did try disabling ALL of my plugins (except for Atom core), restarted Atom, and still got the same behavior.
Here’s my plugin list, though:
soundstruck
If I stage the unstaged files, this happens indefinitely (using either command line, or Atom/VS Code):
OvermindDL1
Hmm, wonder if it is something mac specific, I cannot replicate it on linux…
josevalim
My suggestion would be to disable all plugins and see if the behaviour persists. If it doesn’t, add them back until you see the problem again.
Do you have any plugin that shows which lines are being added/removed from version control directly in the editor? That would be a good starting point.
OvermindDL1
Yeah, I have about everything they have and I don’t get the problem, so testing them via binary search might reveal what’s not working well on Mac’s. For note, grab the Atom Extension 'package-cop`, it allows you to bisect the extensions (it disables half, has you test, either swaps or repeats based on whether you said the issue happened or not, and keep repeating until you find the package with the issue).
soundstruck
Thanks, everyone. I appreciate the suggestions.
I’m continuing to hunt this down.