Any form of Automatic Reloading after code change does not work

Hi there,

When cloning a fresh copy of the project I do get the Fast Reload feature to work but only for a short while. Or after X amount of reloads or something it stops working. The only way to see any updates from that point on is to rerun expo start.

My workaround now is to remove the local repo, restart my computer and re-clone the project again to just have it working for a short while. So something tells my it has something to do with a type of cache or other files beside my project files.

Newly initiated expo projects with just fine, so this makes me feel it’s something within this project.

Expo Diagnostics:

Expo CLI 5.0.3 environment info:
    System:
      OS: macOS 12.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
      Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.2/bin/yarn
      npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
      Watchman: 2022.01.10.00 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    IDEs:
      Android Studio: 2020.3 AI-203.7717.56.2031.7935034
      Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^44.0.0 => 44.0.5 
      react: 17.0.1 => 17.0.1 
      react-dom: 17.0.1 => 17.0.1 
      react-native: 0.64.3 => 0.64.3 
      react-native-web: 0.17.1 => 0.17.1 
    npmGlobalPackages:
      expo-cli: 5.0.3
    Expo Workflow: managed

package.json:

{
  "main": "node_modules/expo/AppEntry.js",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "test": "jest --watchAll",
    "publish:production": "expo publish"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo-google-fonts/poppins": "^0.2.0",
    "@expo/vector-icons": "^12.0.0",
    "@gorhom/portal": "^1.0.11",
    "@react-native-async-storage/async-storage": "~1.15.0",
    "@react-native-community/netinfo": "7.1.3",
    "@react-native-community/slider": "4.1.12",
    "@react-navigation/bottom-tabs": "^6.0.5",
    "@react-navigation/native": "^6.0.2",
    "@react-navigation/native-stack": "^6.1.0",
    "@reduxjs/toolkit": "~1.7.1",
    "@sentry/react-native": "^3.2.3",
    "aws-amplify": "^4.3.0",
    "axios": "^0.23.0",
    "chroma.ts": "^1.0.10",
    "dotenv": "^10.0.0",
    "expo": "^44.0.0",
    "expo-application": "~4.0.1",
    "expo-asset": "~8.4.6",
    "expo-av": "~10.2.0",
    "expo-blur": "~11.0.0",
    "expo-constants": "~13.0.0",
    "expo-device": "~4.1.0",
    "expo-firebase-analytics": "~6.0.0",
    "expo-font": "~10.0.4",
    "expo-haptics": "~11.1.0",
    "expo-linear-gradient": "~11.0.0",
    "expo-linking": "~3.0.0",
    "expo-localization": "~12.0.0",
    "expo-mail-composer": "~11.1.0",
    "expo-notifications": "~0.14.0",
    "expo-splash-screen": "~0.14.1",
    "expo-status-bar": "~1.2.0",
    "expo-tracking-transparency": "~2.1.0",
    "expo-updates": "~0.11.4",
    "expo-web-browser": "~10.1.0",
    "formik": "^2.2.9",
    "i18next": "^21.5.4",
    "lodash": "^4.17.21",
    "moment": "^2.29.1",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-i18next": "^11.14.3",
    "react-native": "0.64.3",
    "react-native-collapsible": "^1.6.0",
    "react-native-confetti-cannon": "^1.5.2",
    "react-native-gesture-handler": "~2.1.0",
    "react-native-image-pan-zoom": "^2.1.12",
    "react-native-modalize": "^2.0.10",
    "react-native-reanimated": "~2.3.1",
    "react-native-render-html": "^6.3.1",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.10.1",
    "react-native-svg": "12.1.1",
    "react-native-swipe-list-view": "^3.2.9",
    "react-native-web": "0.17.1",
    "react-native-webview": "11.15.0",
    "react-query": "^3.34.6",
    "react-redux": "^7.2.5",
    "redux-persist": "^6.0.0",
    "sentry-expo": "^4.0.0",
    "yup": "^0.32.9"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/react": "~17.0.21",
    "@types/react-dom": "~17.0.9",
    "@types/react-native": "~0.64.12",
    "jest-expo": "^44.0.0",
    "typescript": "~4.3.5"
  },
  "private": true
}

I figured it out.

It had to do with my .env’s. I used one called BUILD_NUMBER and I feel it’s also used when running the dev server.

After changing prefixing this with some custom string it worked again.

1 Like

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