Skip to content

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

Open
@hoomanaskari

Description

@hoomanaskari

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.

Activity

petetnt

petetnt commented on Nov 17, 2020

@petetnt
Contributor

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

hoomanaskari commented on Nov 17, 2020

@hoomanaskari
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

Guria commented on Nov 17, 2020

@Guria

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

obsius

obsius commented on Nov 17, 2020

@obsius

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

threepointone

threepointone commented on Nov 19, 2020

@threepointone

This will likely be pushed out in the next release.

stale

stale commented on Dec 25, 2020

@stale

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.

hoomanaskari

hoomanaskari commented on Feb 2, 2021

@hoomanaskari
Author

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

mlarcher

mlarcher commented on Feb 9, 2021

@mlarcher

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

hoomanaskari commented on Feb 10, 2021

@hoomanaskari
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

bdenhollander commented on Feb 10, 2021

@bdenhollander

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

jaryway commented on Aug 24, 2021

@jaryway

react 17.0.2
react-scripts 4.0.3

not wokring for me.

snippetkid

snippetkid commented on Jan 9, 2022

@snippetkid

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

isometriq commented on Feb 12, 2022

@isometriq

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @threepointone@Guria@mlarcher@isometriq@jaryway

        Issue actions

          Provide a way to disable Fast Refresh and fallback to classic browser reload. · Issue #10078 · facebook/create-react-app