Comments (15)
Android 6.0.1, RN 0.42.0, RN Debugger 0.6.2
I've tried:
- Set automatic date + time on my physical device.
requestIdleCallback(() => alert('works!'), { timeout: 1 })
andrequestIdleCallback(() => console.log('works!'), { timeout: 1 })
, neither are called.- Your workaround above using
window
object. - Using the polyfill in an
if (__DEV__) { ... }
statement in my app's entry point.
I still cannot connect to the React dev tools using a physical device (Waiting for React to connect...). I added a console.log()
inside if (__DEV__) { ... }
just to make sure I am running in a dev environment and it prints correctly. I'm unsure what else to try at this point.
from react-native-debugger.
@jhen0409 Thank you, for some reason adb reverse tcp:8097 tcp:8097
works for me now.
from react-native-debugger.
[email protected]
should fixed the problem, please update the package in your react-native project. (Note that it's dependency of react-native
)
from react-native-debugger.
Are you using Android emulator? Maybe it's same with facebook/react-devtools#476 (comment), try the following code on debug mode:
requestIdleCallback(() => alert('works!'), { timeout: 1 })
If it doesn't called alert
, try to reset the date.
$ adb shell "date `date +%m%d%H%M%Y.%S`"
or reset the Android emulator.
from react-native-debugger.
I'm using a real device
from react-native-debugger.
@someone235 same, but you may not have permission to use adb
for set time, open the network and sync time in the setting instead.
It's limitation in debug mode for RN, you need to keep the same device and computer time. (It only warn in more than 60 seconds.)
If it still not work and requestIdleCallback
also, it may be another problem, could you provide more information? (RN version, Android version...)
from react-native-debugger.
requestIdleCallback
callback is not called.
I have Android 6.0.1 and RN 0.39.2.
Do you know how can I do the time sync? I'm not familiar with the subject.
from react-native-debugger.
requestIdleCallback callback is not called.
Looks like it's same problem. :)
Do you know how can I do the time sync? I'm not familiar with the subject.
It's just date & time
setting in Android (it should usually be automatic), if it's automatic, you can just make sure the device and computer on the same network.
If you still have this problem, there is a temporary solution here:
// Not recommended
if (__DEV__) {
window.requestIdleCallback = null
window.cancelIdleCallback = null
}
// Make sure it before call at `import { ... } from 'react-native'`
Or use external polyfill instead. (Like: react-devtools/agent/Bridge.js#L21-L22)
from react-native-debugger.
It did the trick, thank you
from react-native-debugger.
@gustavjf if you got Waiting for React to connect...
, it mean you haven't connect to react inspector server, you can read this section to solve your problem first.
Also, I'm try to fix the problem of requestIdleCallback
with facebook/react-native#13116, if anyone still stuck Connecting to React…
, just waiting for upstream or use the patch.
from react-native-debugger.
I'm having this issue too with the Android emulator and simply can't resolve it… Time on the emulator and my Mac are equal, adb reverse doesn't change anything, window.requestIdleCallback(() => alert("works!"), { timeout: 1 });
apparently isn't called (can't see any alert) and putting the if (__DEV__) …
stuff before import "react-native" also doesn't change anything. Same for a real device (although I need to do adb reverse then because the devtools won't even try to connect – but at least that means SOMETHING is working).
This is the right place, yes?
import React, {Component} from "react";
if (__DEV__) {
window.requestIdleCallback = null;
window.cancelIdleCallback = null;
}
import {AppRegistry, AsyncStorage} from "react-native";
Edit: Small update: It works fine with the iOS simulator, so this is really only happening on Android. Interesting!
from react-native-debugger.
@strayer are you using RN ^0.43? Due to this change (It's no longer exported function), you need put the code before connectToDevTools
, I'll update readme.
(node_modules/react-native/Libraries/Core/Devtools/setupDevtools.js
)
Also, facebook/react-native#13116 looks ready but have some ship problem, if it goes well it should be at RN 0.45.
from react-native-debugger.
@jhen0409 I'm using 0.43 and I added the code before connectToDevTools
to enable the react dev tools. However, the connecting only works after I Stop Remote JS Debugging
. That's weird.
from react-native-debugger.
My fault, it should be const {connectToDevTools} = require('react-devtools-core');
before:
if (__DEV__) {
const AppState = require('AppState');
const {PlatformConstants} = require('NativeModules');
// Put the code here
const {connectToDevTools} = require('react-devtools-core');
......
}
However, the connecting only works after I Stop Remote JS Debugging. That's weird.
The requestIdleCallback
problem is only cause on Debug JS Remotely
mode.
from react-native-debugger.
Fixed in facebook/react-devtools#749, please waiting for the new version of the react-devtools-core
package.
from react-native-debugger.
Related Issues (20)
- How to Enable log (AppEntry) HOT 1
- Debugging Native Modules
- 无反应
- Error launching JS inspector: _open(...).default.openApp is not a function HOT 6
- Devtool dosen't work with Expo on Ubuntu 20.04 HOT 2
- The react native page is not updated after modification
- I want to copy object like google chorme HOT 1
- [Discussion] Future plan for RND (Expo 49+)? HOT 5
- Console window issue HOT 6
- Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) HOT 1
- Unable to enable network debugging, unable to debug Api HOT 2
- "Pause on exception" has disappeared HOT 1
- At a high level how does React Native Debugger connect to an app? HOT 2
- 302 Redirect. Network does not send cookies
- how to install on ubuntu
- devtools does not show. it's blank HOT 9
- waiting for client connection HOT 12
- Can't open RN Debugger HOT 2
- Troubleshooting React Native Debugger: A Step-by-Step Guide - Windows HOT 1
- Encountering difficulties debugging a default React Native app in Chrome Debugger due to Flipper, with a warning signaling the deprecated status of debugging via Flipper, necessitating installation of Flipper on the system to handle the 'flipper://' URL scheme HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-debugger.