Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expo Client: Fast Refresh not working (React Native)

I am developing a React Native application using Expo Client, I am also using the android emulator from android studio to connect to see all my changes live.

However the fast refresh doesn't work, I can only see changes if I restart the development server which makes the workflow extremely long and tedious.

I have tried many fixes that are listed in these posts here Link1 and here Link2.

To summarise the fixes I have tried but did not solve my issues:

  1. deleted package-lock.json and reinstall (using npm install --package-lock-only)
  2. Deleting Expo app off the emulator, wiping emulator data and cold booting it then re installing Expo app
  3. Clearing browser cache and turning on and off remote debugging js (this method is covered in the the first link)

None of these have worked for me.

I'm including the package.json file just this might be needed.

package.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/bottom-tabs": "^5.11.8",
    "@react-navigation/material-bottom-tabs": "^5.3.14",
    "@react-navigation/native": "^5.9.3",
    "@react-navigation/stack": "^5.14.3",
    "expo": "~40.0.0",
    "expo-app-loading": "^1.0.1",
    "expo-av": "~8.7.0",
    "expo-font": "~8.4.0",
    "expo-status-bar": "~1.0.3",
    "native-base": "^2.15.2",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
    "react-native-gesture-handler": "~1.8.0",
    "react-native-paper": "^4.7.2",
    "react-native-reanimated": "~1.13.0",
    "react-native-safe-area-context": "3.1.9",
    "react-native-screens": "~2.15.2",
    "react-native-web": "~0.13.12"
  },
  "devDependencies": {
    "@babel/core": "~7.9.0"
  },
  "private": true
}
like image 536
MicSt Avatar asked Sep 05 '25 03:09

MicSt


1 Answers

I solved my own problem as follows;

In project directory just run

rm -f ./.git/index.lock

I hope your problem is solved in this way.

like image 195
hkacan Avatar answered Sep 07 '25 22:09

hkacan