Using a simulator or physical device on "Debug" mode, the app is running a previous cached version of the code being ran. If i was to change
<Text style={styles.buttonTitle}>Monthly</Text>
to
<Text style={styles.buttonTitle}>Yearly</Text>
The app shows "Monthly" rather then the updated version of "Yearly".
After clicking "Stop Debugging" the app then shows the "Yearly" version, but when i go back to Debug the app will once again show "Monthly"
React Native version:
System:
OS: macOS 10.15.1
CPU: (8) x64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
Memory: 1.95 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.15.1 - /usr/local/bin/node
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5900203
Xcode: 11.2/11B52 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: ^0.61.4 => 0.61.4
npmGlobalPackages:
react-native-cli: 2.0.1
Describe what you expected to happen:
I expect that when i change the values in my code, while in Debug mode, the app updates along with the code.
For anybody else who has this issue, I think the reason was because my physical device was not on the same Wifi as my computer.
Got same issue a couple of times on simulator.
Tried restarting Metro Bundler, run on different simulators. Still keep running cached code when Debug enabled.
It gets fixed after some time, don't know how.
Using react-native: 0.61.1
yeah same issue here too,
even with this clean script, clean ios build and rebuild.
watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && yarn cache clean && yarn && yarn start -- --reset-cache
Same issue here
This seems to fix it: https://github.com/jhen0409/react-native-debugger/issues/188#issuecomment-360233760
Most helpful comment
Got same issue a couple of times on simulator.
Tried restarting Metro Bundler, run on different simulators. Still keep running cached code when Debug enabled.
It gets fixed after some time, don't know how.
Using react-native: 0.61.1