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

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

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
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews