Why expo hot reload sometimes happend with no aparent reason? - react-native

Sometimes with no aparent reason the app gets refreshed, sometimes when i open a file. And when i add a library the expo development server crash, i think that maybe is something with watchman configuration that i don't know how to change. This is enoying.Any help?
PD: I'm using vscode

fast refresh will happen any time a file is changed in your project directory. if you have some other tools that run in that same directory and cause files to be changed then it could be happening seemingly randomly

Related

Hot Reload only works with changes in App.js

Hot reload feature on expo only seems to work when I modify and save App.js.
If I save my changes on a different file, nothing happens. If a change a different file, save it, and then save App.js as well to hot reload the changes, the app refreshes but the changes to the external file aren't there.
I've already checked my network, ran under the tunnel configuration and nothing really seemed to work. I was wondering if anyone else is having a similar issue.
The only thing that made hot reload work was placing the file in the same directory as App.js. I've had the same issue and I couldn't find any other solutions either. Before I figured this out I always had to refresh the server with expo start -c --tunnel. Without the -c flag it didn't refresh my custom components.

Stuck on Downloading Javascript Bundle 100% - Expo

I guess that I've tried every solution that exists on the internet about this issue, and nothing works, and I don't even know where to look anymore. It started to happen from nowhere and I can't even open the app settings shaking the phone, it's completely stuck on this screen.
I cleaned up NPM, Yarn, Expo's caches and disabled the Remote Dev Tools.
I would be so much thankful for any help.
In my case it was due to the a remote debugger.
I left the remote debugging on, put the mac in sleep and when I turned it on again the iOS Simulator remained stuck at bundling 100%, irrespective of what I've tried (kill simulator, expo r -c, Reload app, etc.)
However, I could have realized the root cause earlier because on the physical device it was working the entire time.
Hope this saves someone some time.
You could try reverting to your last known working commit, then incrementally adding back the changes until this happens again. This often is a result of delaying hiding the splash screen (perhaps via AppLoading or SplashScreen) and then not hiding it because of some error in the app code preventing the code to hide it from being called.
Try Disable Debug Remote JS in the IOS Simulator
by clicking ctrl + cmd +Z on Mac
It works for me.
Seems like something is wrong with the dependencies, just close down the react-native environment ( android studio) and your IDE, just closing and restarting may work if not, check for updates or delete and reinstall your dependencies ( expo i )

React native chrome debugger not showing that console.log and default logs

i recently upgraded from RN 0.61.5 to 0.62.2.
However, chrome debugger won't work from some point on. This means that the debugger and simulator are well connected, but I don't see any of the basic logs that I use console.log, or that first pops up logs.
So, i try some solutions.
first, I reset the project. and run react-native init <my-project>. and copy & paste past source code(Except for system files or node_modules) that src, .gitignore etc
but, this situations keep goes on now.
second, git revert when it worked well before upgrade.
but this is same bad result like above. everything is good. project's Run or Build ···.
ONLY NOT WORKING debugger..
what should i do ?
Thank you in advance for your help.
Please look this picture
SELF ANSWER
One of the Babel packages I'm using, the Babel-plugin-transform-remove-console, had eliminated all the logs even in development mode.
If you remove this from the project, it works normally.

Need to restart computer when developping

I try to make apps in react native (not with expo, I created my code with react-native init and run with react-native run-android) and when I make changes in the code they are not always taken into account : to take them into account I have to restart computer.
I have to do it several times a day, it is time consuming. I have tested to remove to app tested from the device, to make yarn cache clean, but it doesn't work, the only thing that works is to restart (I am using a Mac if it makes a difference).
Is there a command I can make to reset a cache that I don't know and save previous state of my app ?
You may have a caching issue, try the cache clearing solutions in this link
How to clear react-native cache?
And also, you may want to try the Hot Reloading or Live Reloading options in the dev menu.
What is the difference between Hot Reloading and Live Reloading in React Native?

Remote JS Debug Enabled - cached bundle

This is really weird I can't explain it.
On Android, I have my device. I connected it via USB debugging. Things were working fine last night. Now, when i have remote debugging enabled, its using a cached version of the bundle or something, because my changes are not coming through.
I did a cd android and ./gradlew clean and then restarted metro bundler, run-android, and even restarted device. However no matter what, if remote debugging is enabled, its using an old bundle and not reflecting my newest changes.
Its even more weird because I have "live reload" enabled and whenever I save it does trigger a reload of the app, but its not with my newest changes!
Does anyone know whats going on and how to fix?
Try to delete folder android/build, it helped for me
I had it too - cleaning my Chrome’s cache solved the problem for me!