question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RN 0.52] New YellowBox.ignoreWarnings fail to ignore listed warnings

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
  OS: macOS Sierra 10.12.6
  Node: 9.3.0
  Yarn: 1.3.2
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: Not Found

Packages: (wanted => installed)
  react: 16.2.0 => 16.2.0
  react-native: 0.52.0 => 0.52.0

Steps to Reproduce

$ react-native run-ios

Expected Behavior

iOS simulator run without showing ignored YellowBox warnings

Actual Behavior

screenshot 2018-01-09 14 53 14

Reproducible Demo

I have in index.js:

import React, {Component} from "react"
import {
  AppRegistry,
  StyleSheet,
  View,
  Dimensions,
  StatusBar,
  YellowBox,
} from 'react-native'
YellowBox.ignoreWarnings = ([
  'Encountered an error loading page',    // WebView uri: result.url and url failing to load - "bloomberg suneq" https://github.com/facebook/react-native/issues/7839#issuecomment-224111608
  'Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  'Task orphaned for request ',
  'Remote debugger is in a background tab which may cause apps to perform slowly',
])

This is not the case with the previous form: console.ignoredYellowBox = [...] prior to this change in RN 0.52. The 2 YellowBox warnings in screenshot above got properly ignored. Now in RN 0.52, the only way I can as a workaround suppress these YellowBox warnings is by adding a catch-all disable to my index.js:

console.disableYellowBox = true

Am I missing something in my `YellowBox.ignoreWarnings = ([…]) specs so they aren’t actually ignoring?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

16reactions
crobinson42commented, Apr 18, 2018

I am running RN 0.55.2 and I followed the docs but I am still getting yellow box warnings with both a specific error to ignore and also trying console.disableYellowBox = true;. Neither case is effective at stopping any yellow box warning messages from popping up. I have wiped the app, cache, reinstalled, etc., no dice. Any thoughts on how I can resolve this? Thx!

16reactions
wayrunnercommented, Jan 12, 2018

Seems to be a error in the documentation. This works for me:

import {YellowBox} from 'react-native'
YellowBox.ignoreWarnings([
  'Encountered an error loading page',    // WebView uri: result.url and url failing to load - "bloomberg suneq" https://github.com/facebook/react-native/issues/7839#issuecomment-224111608
  'Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  'Task orphaned for request ',
  'Remote debugger is in a background tab which may cause apps to perform slowly',
])
Read more comments on GitHub >

github_iconTop Results From Across the Web

how to disable YellowBox in react-native totally in a native ...
YellowBoxes can be disabled during development by using console.disableYellowBox = true;. using ignore. console.ignoredYellowBox = ['Warning: ...
Read more >
Disable the Yellow Box in React Native - Code Daily
The Yellow warning box in React Native can be both helpful and annoying. There are many errors that can be ignored but end...
Read more >
How to Disable Yellow Warning Box in React Native
In the second case where you want to ignore the error and it is also blocking necessary pieces of the application, you can...
Read more >
ReactNativeでignoredYellowBoxではなくYellowBox ... - Zenn
[RN 0.52] New YellowBox.ignoreWarnings fail to ignore listed warnings · Issue #17503 · facebook/reac. Is this a bug report?
Read more >
axios-case-converter-updated - npm package - Snyk
RN >= 0.52 import { YellowBox } from 'react-native'; YellowBox.ignoreWarnings([ 'Be careful that FormData cannot be transformed on React Native.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found