soundstruck

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.

Showing Posts 1 to 10

tcollen

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

soundstruck OP

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. :frowning:

soundstruck

soundstruck OP

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

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

soundstruck OP

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:

atom-beautify@0.30.9
atom-elixir@0.2.3
atom-handlebars@1.3.0
atom-jshint@2.0.0
atom-live-server@2.2.0 (disabled)
atom-prettify@0.1.3
autocomplete-cfml@0.5.0
busy-signal@1.4.3
color-picker@2.2.5
elixir-cmd@0.2.9 (disabled)
emmet@2.4.3
ex-mode@0.18.0
file-icons@2.1.16
file-types@0.5.5
fonts@3.0.3
highlight-line@0.12.0
highlight-selected@0.13.1
html-to-elm@0.2.0 (disabled)
intentions@1.1.5
language-babel@2.83.1
language-cfml@0.17.1
language-elixir@0.20.3
language-elm@1.5.0 (disabled)
language-erlang@3.2.0
language-spacebars@0.2.2 (disabled)
language-vue@0.23.1
linter@2.2.0
linter-elm-make@0.28.1 (disabled)
linter-eslint@8.4.1
linter-ui-default@1.6.10
minimap@4.29.7
minimap-highlight-selected@4.6.1
minimap-pigments@0.2.2
multi-cursor@2.1.5
pigments@0.40.2
react@0.17.0 (disabled)
sync-settings@0.8.3
todo-show@2.1.0
vim-mode-plus@1.27.0
vim-surround@0.8.1 (disabled)```
soundstruck

soundstruck OP

If I stage the unstaged files, this happens indefinitely (using either command line, or Atom/VS Code):

14:13:38 - info: compiling
14:13:39 - info: Reloading watcher...
14:13:44 - info: compiling
14:13:45 - info: Reloading watcher...
14:13:49 - info: compiling
14:13:50 - info: Reloading watcher...
14:13:54 - info: compiling
14:13:55 - info: Reloading watcher...
14:14:00 - info: compiling
14:14:01 - info: Reloading watcher...
14:14:05 - info: compiling
14:14:07 - info: Reloading watcher...```
OvermindDL1

OvermindDL1

Hmm, wonder if it is something mac specific, I cannot replicate it on linux…

josevalim

josevalim

Creator of Elixir

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

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

soundstruck OP

Thanks, everyone. I appreciate the suggestions.

I’m continuing to hunt this down. :slight_smile:

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews