Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get rid of "Remote debugger is in a background tab" warning in React Native

Tags:

react-native

I've started a new React Native project and I keep getting the following warning:

Remote debugger is in a background tab which may cause apps to perform slowly. Fix this by foregrounding the tab (or opening it in a separate window).

It's a bit annoying so I wanna know how I can get rid of it? I'm running the debugger in Chrome and I moved it to a seperate window but it did not help.

like image 578
mxmtsk Avatar asked Dec 14 '16 15:12

mxmtsk


People also ask

How do I run react native apps in debug mode?

In App Developer MenuOn Android emulator, you need to press command + M. Debug JS Remotely − Used for activating debugging inside browser developer console. Enable Live Reload − Used for enabling live reloading whenever your code is saved. The debugger will open at localhost:8081/debugger-ui.

How do I use react native Chrome debugger?

To use a custom JavaScript debugger in place of Chrome Developer Tools, set the REACT_DEBUGGER environment variable to a command that will start your custom debugger. You can then select "Debug JS Remotely" from the Developer Menu to start debugging.


1 Answers

If you have the Maintain Priority checkbox in the debugger window, try enabling it before you jump to any of the solutions below.

To get rid of the warning in your whole project add the following to your outermost Javascript file (most of the time that's index.js for React Native)

for react-native v0.63+:

Use LogBox: https://reactnative.dev/docs/debugging#logbox

LogBox.ignoreLogs(['Remote debugger']); 

for react-native v0.57 - v0.62:

import { YellowBox } from 'react-native'; YellowBox.ignoreWarnings(['Remote debugger']); 

Reference this from the official React Native docs:

https://facebook.github.io/react-native/docs/debugging.html

react-native v0.56 or below:

Add the following early on in your code:

console.ignoredYellowBox = ['Remote debugger']; 

Easy, simple and specific to that error. Works for me. Can substitute for any text you want.

like image 197
kjonsson Avatar answered Sep 19 '22 06:09

kjonsson