question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running Debug runs a previous cached version of code

See original GitHub issue

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® Core™ 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

Steps To Reproduce

  1. Run app on Debug, and change values / actions etc.
  2. App values won’t change
  3. Turn off Debug, and the values will have changed
  4. Turn on Debug, values will go back to previous values

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

3reactions
breahna-ebscommented, Nov 21, 2019

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

2reactions
export-mikecommented, Dec 9, 2019

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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio 2017 Builds the code but runs a previous version.
When I came in on Monday I made some small code changes to one page and tried to run the project to see...
Read more >
Visual Studio is caching old versions of assemblies during ...
During debugging you can open Debug->Windows->Modules to check if the right dll is loaded. – shingo. Oct 3, 2020 at 11:47.
Read more >
PyCharm using cached version instead of current code
Opening the local file works fine, but PyCharm seems to mess up its indexing and references cached versions for debugging, GoTo->Declaration etc. This...
Read more >
Debugging and diagnosing cache misses - Gradle User Manual
Testing cache relocatability ; 2, Go to the first checkout directory. ; 3, Clean the project to remove any unwanted leftovers from previous...
Read more >
Caching Dependencies - CircleCI
By reusing the data from previous jobs, you also reduce the cost of fetch operations. After an initial job run, subsequent instances of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found