react-native: Reloading App not updating for the latest modified code

Environment

  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
      Memory: 1.46 GB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.8.0 - /usr/local/bin/node
      Yarn: yarn install v0.23.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 22.06s. - ~/.npm-packages/bin/yarn
      npm: 5.6.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
      Android SDK:
        Build Tools: 23.0.1, 23.0.2, 23.0.3, 24.0.0, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3
        API Levels: 19, 20, 22, 23, 24, 25, 26, 27
    IDEs:
      Android Studio: 3.1 AI-173.4720617
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0 
      react-native: 0.57.0 => 0.57.0 
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7
      react-native-rename: 2.2.2

Description

Hi I create a new app using RN v0.57.0, the issue when I try to hot reloading or live reload (or normal reload) it didn’t update with the latest code I edit. Both iOS and Android are not updating to the latest changes I did and the only solution I can do for now was to restart my macbook pro. Do you know any links or documentation on how to fix this issue? I also tried the solutions suggested on this code https://github.com/facebook/react-native/issues/9977

thanks,

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 15
  • Comments: 15

Most upvoted comments

deleting .git/index.lock worked for me.

You can shake the device or press R and enable hot reloading. Hot Reloading does not appear to be enabled by default.

@neonsec where is .git/index.lock located?

@neonsec Cool, it do works !

and I find a reason why this happened

https://github.com/facebook/watchman/blob/4b98623e8fde17588f27494f3ae8f084b9b227d3/QueryableView.cpp#L48

it looks like when a .git/index.lock or a .hg/wlock file exist, watchman will do nothing

Closing in favour of https://github.com/facebook/react-native/issues/18899, since they are related.