Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to disable Fast Refresh and fallback to classic browser reload. #10078

Open
hoomanaskari opened this issue Nov 16, 2020 · 13 comments

Comments

@hoomanaskari
Copy link

Hi,

Recently upgraded to CRA 4 and it's great so far. Well, almost great. While the new fast refresh works great on our landing pages, it does not work on our core app. The issue is that our core app relies heavily on events and js canvas, and that's where fast refresh does not work well, or at all.

Is there a way to optionally disable the fast refresh and fallback to browser reload on file save/update? I tried adding FAST_REFRESH=false env but it did not work.

Thanks in advance.

@petetnt
Copy link
Contributor

petetnt commented Nov 17, 2020

Hi @hoomanaskari, setting FAST_REFRESH=false should work, eg. by running FAST_REFRESH=false npm start.

Can you provide a repro repo or similar demo? Thanks!

@hoomanaskari
Copy link
Author

@petetnt Thanks for the reply. Yes, I can confirm that adding FAST_REFRESH=false to npm command does disable it, for some reason it did not work when I added it to my .env file.

But the issue now is that it disables the whole thing, prior to this update, browser reloaded upon file save, but now it's either fast refresh or nothing. I was wondering if there is a way to optionally fallback to the previous system (browser reloading on file save)?

@Guria
Copy link

Guria commented Nov 17, 2020

@petetnt it might disable FAST REFRESH feature but it doesn't return browser reload on changes behaviour.

@obsius
Copy link

obsius commented Nov 17, 2020

#9884 fixed this three weeks ago. Not sure why the delay to push this fix and others.

@threepointone
Copy link

threepointone commented Nov 19, 2020

This will likely be pushed out in the next release.

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Dec 25, 2020
@hoomanaskari
Copy link
Author

This issue is not yet fixed in the latest version of react-script. Still browser does not refresh automatically when FAST_REFRESH=false.

@stale stale bot removed the stale label Feb 2, 2021
@mlarcher
Copy link

mlarcher commented Feb 9, 2021

We're using react-script 4.0.1 and using FAST_REFRESH=false react-scripts start gives us the expected (previous) behavior of page reload on change

@hoomanaskari
Copy link
Author

Yes that is right, removing the node_modules, upgrading to react-scripts 4.0.2 and re-installing the node modules somehow resolved it for me too!

@bdenhollander
Copy link

On Windows with react-scripts 4.0.1, setting FAST_REFRESH=false in a .env file works when launching yarn start from Powershell but not from Command Prompt.

@jaryway
Copy link

jaryway commented Aug 24, 2021

react 17.0.2
react-scripts 4.0.3

not wokring for me.

@snippetkid
Copy link

react 17.0.2
react-scripts 4.0.2
FAST_REFRESH=false react-scripts start works only for JS file updates. On CSS updates, fast refresh happens and my whole site freezes.

@isometriq
Copy link

Could it be possible to disable by default this experimental feature?
Only activated by devs when FAST_REFRESH is really desired and useful..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants