Chrome debugging and slowness in RN apps - react-native

Every now and then, my iOS simulator becomes extremely slow. Am unable to deterministically say when this happens. One solution seems to be "Reset Content and Settings.." effectively turning off chrome debugging and then restarting the app. Has anyone faced this issue ? If yes, are there any solutions to continue debugging in Chrome without any performance hit.
Didnt face this on the previous versions. Now on ^0.35

React Native console.log will slow everything down if Chrome tab displaying the log messages is not visible. You can try react native debugger and see if you have same issues.
https://github.com/jhen0409/react-native-debugger

Related

React native while debugging pointing issue

When enabling "Debugging" in the ios simulator and open chrome for debugging.
The first time works perfectly but when change code and refresh automatically.
After that Debugging points somewhere else. I understand there is a mapping issue while debugging.
Any solution for this?
Debugging mapping attached to the project when we start project or reload but at the time of hot reloading (auto refresh) will not update that mapping correctly.
For update the mapping correctly you have to reload it.
In physical devices: Shake the device it will open a window choose 'reload' option.
For simulator: by pressing command+R or command+control+z and choose 'reload' option.
For emulator mac OS: by pressing r+r (2 times).
In chrome developer tools, try switching to network tab, and check "Disable cache". It might help

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 )

"Unable to resolve module" debuggerWorker errors in recent react-native releases

I keep my project(s) relatively up to date with the latest RN releases. This error seems to be coming up more and more lately.
Error: Unable to resolve module `./debugger-ui/debuggerWorker.d9da4ed7` from ``:
None of these files exist:
* debugger-ui/debuggerWorker.d9da4ed7(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
Really makes it hard when trying to debug issues and a debugger statement does noting and errors are not reported to the browser tab where the console output goes.
I've already tried wiping node_modules. Is this a known issue with a concrete fix available?
Got stuck with this exact issue for hours. Just found that this occurs only on device where app is already installed with debug mode enabled.
I fixed it by:
uninstalling manually app from device (cmd+H to display simulator home) then long click on app icon and click on cross to delete app => this forces disabling debug mode,
then run app again from xcode.
Enabling debug mode after that works normally.
I had to come across a similar issue after updating #react-native-community/cli-debugger-ui to 4.2.1. Tried out several methods, nothing worked. Reverting #react-native-community/cli-debugger-ui back to 3.0.0 resolved the issue for me.
I closed the app (pressing home twice and swiping up), then started it again from the simulator and it worked.
Happens to me recently using expo and android.
The solution was to clear all Expo Go data:
Long press the Expo go icon
Then select App info
At the bottom of the screen, press Clear Data
And press Clear all data
Relaunch expo go and the react native app

Infinite loop callbacks_poll React Native Debugger

I see this endless loop in the debugger network pane, both in Chrome and React Native Debugger using iOS Simulator and RN 0.49.5.
It basically shows and endlessly increasing number of network requests with the name callbacks_poll. I even see them when return null from my main App file. Tried clearing cache, resetting simulator, hard restart, etc. Any idea how to stop this?
I just came across to the same error, with a bit of search found that the reason was the realm library.
If you do use realm, you can follow up the github issue here: https://github.com/realm/realm-js/issues/1538

Chrome debugging of react-native not working

I have been developing with React Native and in the past I was able to debug with Chrome devtools, though it was often sub-optimal and really affected application performance.
Know Chrome devtools just don't work. I try setting breakpoints and they don't set, or jump to some random line far below where I wanted it. I try adding "debugger;" to the code and the debugger does not stop on it.
Nothing seams to work and I have been using console.warn as my debugging, which is not awesome. I have read the docs etc. Any help would be welcome.
Ensure that "JS Dev mode" is on and and "JS minify" is off in Dev settings (Shake menu). In the past this has happened to me on many occasions where I would turn Dev mode off and forget. Breakpoints will not be hit if it's off.