Expo start only runs cached code

Whenever I run expo start via npm start, the app that loads is some cached version that doesn’t represent current code. I’m using an android device and an ubuntu 18 distro. My versions are as follows:
Expo: 32.0.2
Expo-CLI: 2.7.1
watchman: 4.9.0
Node: 11.6.0
npm: 6.7.0

Here are the things that I’ve tried:

I installed expo and had some trouble getting watchman working. I configured watchman with --enable-lenient --without-python. I adjusted the watchman inotify levels to 999999 with the following command echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_instances && watchman shutdown-server

Development went smoothish, but after a time, I stopped seeing any kind of error messaging and hot-reloading stopped. It became impossible to open developer options in the running app by shaking the phone. I didn’t really register that anything was wrong because the app was still updating to reflect new code.

This morning, I received errors regarding the watchman inotify limit again. I reran the command to set the max watch limits to 999999 with the above mentioned command.

This appeared to fix everything. Error messages returned and the developer menu was available again. Hot reloading came back. I made a few changes to some console logging statements.

Then it stopped again. The app reverted to old console logging messages. I’m not sure what I did to cause this, but hot-reloading, error messages, and developer menu stopped. It doesn’t even say ‘bundling javascript’ when I reload the app. It just says running application "main" with appParams: {...} __DEV__ === false, development-level warning are OFF, performance optimizations are ON

I’ve run the following commands unsuccessfully to eliminate the cached code:
watchman watch-del-all; rm -rf $TMPDIR/react-*;rm -rf $TMPDIR/haste-*; rm -rf $TMPDIR/metro-*; rm -rf node_modules/; npm cache verify; npm install; npm start --reset-cache

I am receiving no useful errors. How can run the current code and how can I keep expo running properly?

Thanks

2 Likes

I fixed the issue by clearing the storage of the expo app on my phone. My phone had cached the app and was running it from the cache. Is there a way to change that setting?

2 Likes

Hey @jklingen,

Glad you figured things out. Unfortunately there isn’t and this seems to occur every so often with Android devices. The best strategy moving forward would be to occasionally clear out the app cache and storage.

Cheers,
Adam

1 Like

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