-
Notifications
You must be signed in to change notification settings - Fork 947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Native 0.44 Setting a timer for a long period of time warning #432
Comments
I've tested it too by enabling and disabling reactotron. Same problem. |
This is related to something that socket.io is doing as noted by the stacktrace in the warning. In the next major version of Reactotron Socket.io is getting replaced with regular web sockets so this issue should go away. So long as you are only setting up Reactotron in dev mode this warning should not cause you any issues in the short term. |
Hi, I think I found the solution: |
I saw this issue on android as well. Short term: i'll look into socket.io to see if i can modify Longer term: delete socket.io. |
This is now available. |
@skellock |
zoinks! i forgot to push to brew! pushing now... it usually takes a few hours for them to accept the PR. |
Awesome, thank you! |
Thanks @skellock |
This is our PR here: |
brew cask install is still showing EDITED: Need to run |
I have same issue, my OS WIN 10 and install the tron using npm |
What version of the app? And what version of the library? |
Getting this error on Version 1.11.0. |
@skellock |
Ya, sorry mate, this error came back with the latest React Native. |
What is the stable version of ReactNative without this error? |
46? |
No. I've checked with v 0.46. |
Can this be reopened? I'm still having this problem on the latest versions. |
I have reopened this. I should have time later this week to check into what is going on here. |
Hey guys! Any fix for this error? |
I have same issue, nothing helps |
Sorry, I haven't found the time to take a look at this one yet however I have not seen this warning running RN version 48.4 and Reactotron 1.12.3. Can you guys that are seeing this report the specific versions of RN and Reactotron you are using? |
I am getting this on RN 0.49.5 |
It happens on React Native apps on android where a timer is set for longer than I've seen others suggest a library wrapper for timers on Android, but I dunno. |
I haven't set any timers either. I have a very basic app (intro example) which is just reading 2 or 3 items from the db and listing them in to do list. the warning shows up right off the bat on startup. |
You don’t necessarily need to start the timer. It’s any library that has a timer. Like socket.io or Firebase among others. |
Ah ok. Yes I am using Firebase so that may be it |
I'm also have this issue with socket.io-client and I'm wondering what
happening with warning in production build?
…On 31 Oct 2017 09:27, "BobAleena" ***@***.***> wrote:
Ah ok. Yes I am using Firebase so that may be it
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#432 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYCUkA0az1SeF7OFZKR7MKIZ58IRbEzfks5sxtnggaJpZM4NhH3M>
.
|
That warning only happens in dev builds. I think what the React Native team is trying to say is that on Android, long running timers are best handled with a native solution and not via javascript. I'm not sure there's any specific guidance from them other than that. This is why it's confusing. At least to me it is. =) |
@franjoSpark I also had same issue with socket.io-client in dev builds. |
constructor() {
} OR import BackgroundTimer from 'react-native-background-timer'; setTimeout = BackgroundTimer.setTimeout.bind(BackgroundTimer) |
@phatnguyenbg works only at the first time. When the modal is called it appears =/ |
Reinstalled Reactotron version v1.11.2 solved my problem. |
In reference to the answer provided above by @skellock. For anyone who is facing this issue because of socket.io on React-Native then you need to edit the server side code like: ... Note - I am using express with socket.io on server and socket.io-client on react-native. |
@pallavbakshi Thanks, solved my problem. I had been using socket.io with React Native. |
@phatnguyenbg you saved my life. many thanks. |
This fixes the yellow box and the console log. It even fixes it for Expo. Simply place the following script at the beginning of your codebase. import { YellowBox } from 'react-native';
import _ from 'lodash';
YellowBox.ignoreWarnings(['Setting a timer']);
const _console = _.clone(console);
console.warn = message => {
if (message.indexOf('Setting a timer') <= -1) {
_console.warn(message);
}
}; |
I've encapsulated the previous logic into two npm modules, one for general node/javascript and one for react-native. The react-native module is compatible with expo apps. https://github.com/jamrizzi/ignore-warnings You would use it the following way . . . import ignoreWarnings from 'react-native-ignore-warnings';
ignoreWarnings('Setting a timer'); |
@jamrizzi This did not work. I get an undefined is not a function error on the ignoreWarnings function. |
@cmcaboy I'm sorry it's not working. Could you file it as an issue at https://github.com/jamrizzi/react-native-ignore-warnings/issues. I would definitely love to figure out what the bug is and fix it. |
@pallavbakshi thanks!! Works for me... Im using Socket.io with RN. |
2.x drops socket.io. 👋 |
1) Go tonode_modules/react-native/Libraries/Core/Timer/JSTimers.js 2) Changebefore: |
I use firebase and had the same issue. I solved it using recursion, in this way:
and set up a logout timer with this function:
The variable timer is declared on top level of the file consists all described functions, in this way let timer; |
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Hi,
Since I updated RN to 0.44 is appearing this alert, I thought it was for my code but I close Reactotron and it disappears magically.
Why is this happening? My code? RN? Rectotron?
Thanks!
Reactotron version: 1.10.0
Note: I visited the issue link facebook/react-native#12981 but on there everybody mention Firebase and it isnt my case
The text was updated successfully, but these errors were encountered: