Thursday, February 27, 2020

[React Native] - Fast refresh stop working!

If you are developer and working with React Native, you know all the advantages of fast refresh when you write your app. This feature are available from version 0.61 of react native (original post)

But if this feature stop working when you need them?

It happened to me and just changed the versions of external modules!

Start searching for solutions! https://github.com/facebook/react-native/issues?q=is%3Aissue+Fast+refresh+stop+is%3Aclosed

But the problem persist!

Resolution attempts (without success)

1. Revert all changes on external modules!


2. Clear all caches and external dependencies (npm, watchman and node_modules)


rm -rf ~/.npm
watchman watch-del-all
rm -rf node_modules

npm i
Panic mode ... Still not working!!!

My last hope, checkout the project to new folder try to see if it works... and i'm happiness, fast refresh working again.

So, just need compare the differences between this two same projects folders and find the changed files!

Differences founded...

File: git/.git/index.lock
I think this differences still related with my changes on external modules, but let me try to delete the lock file and run my project again.

Oh yes! The fast refresh working again.

Conclusion, if you have the same problem, only need delete git/.git/index.lock (on your base project folder) to get back fast refresh working.

rm -rf git/.git/index.lock

No comments :

Post a Comment