Weird behaviour when opening a file in VS Code: app refreshes over and over

Hello,

My expo client refreshes and builds over and over when I open a file in VS Code, there’s no need to save, which I understand is when the refresh function fires. In this case, I just open a file and the app starts “downloading changes” then rebuilding JS and updating, then it downloads more “changes” and rebuilds and again updates but I haven’t made a change in the code.

Do you know what it could be?

Thanks in advance.

Hey,

Same happening to me for a long time and couldn’t solve it. :frowning:
I tried running as administrator
run expo with --clear params
refresh expo cli, npm, yarn, node

Unfortunately nothing helped.
Very annoying bug so far. Slows down my develeopment.
I beleave VS Code makes some file attribute or some hidden changes in background.
And sometimes i just get “Finished building JavaScript bundle in xxx ms.” like infinite loop till simulator get crashed.

Anybody found a solution for this? it is extremely annoying…

What OS are you using?

Do you have watchman installed?

I’ve found this thread that says installing watchman might fix it:

And here’s another person who says that worked for them:

Thanks for responding, I haven’t tried watchman, but I think I might have found a solution for my case. Instead of choosing project folder in VS code in Files->Open Folder… I chose a parent folder and then just navigated to the files from there. That way switching between files doesn’t cause app to refresh by itself and works only when you save changes.

It seems like VScode creates some temp files when you edit, and that fires refresh, but Idk, I am new to this.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.