Logbox warnings/errors raised during component render don't have useful content
See original GitHub issueDescription
If a Logbox error or warning is raised during component render there is no information about which component raised the error, its stack, or its position in the view hierarchy. Information printed is just a stack of the call to addLog(log: LogData)
inside LogBoxData.js:197
instead of information about the component that logged the warn/error.
Screenshots illustrate better from a fresh react-native-init with a console.warn added to a function component:
It’s all internal info, nothing very useful.
React Native version:
$ C:\dev\LogBoxStackError\node_modules\.bin\react-native info
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.20161
CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
Memory: 10.06 GB / 31.93 GB
Binaries:
Node: 10.18.1 - ~\AppData\Local\Temp\yarn--1595094823239-0.10804363425476082\node.CMD
Yarn: 1.22.4 - ~\AppData\Local\Temp\yarn--1595094823239-0.10804363425476082\yarn.CMD
npm: 6.13.4 - C:\dev\tools\nodejs\npm.CMD
Watchman: 4.9.4 - C:\dev\tools\watchman\watchman.EXE
SDKs:
Android SDK:
Android NDK: 21.0.6113669
IDEs:
Android Studio: Not Found
Languages:
Java: 11.0.8
Python: 3.8.4
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.1 => 0.63.1
npmGlobalPackages:
*react-native*: Not Found
Done in 1.21s.
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
react-native init TestProject
- Add
console.warn("something")
anywhere in App.js - Run project on Android emulator then tap on LogBox warning
Expected Results
Expected to see information about the component where the error or warning was logged.
Snack, code example, screenshot, or link to a repository:
Repo created with exactly the above steps: https://github.com/AndrewMorsillo/LogBoxStackError
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:10
Top Results From Across the Web
How do you hide the warnings in React Native iOS simulator?
According to React Native Documentation, you can hide warning messages by setting disableYellowBox to true like this: console.disableYellowBox = true; ...
Read more >Understanding the "Objects are not valid as a react child" Error ...
The "Objects are not valid as a React child" error happens when trying to render a collection of data by mistakenly returning the...
Read more >Errors and warnings - Expo Documentation
Learn how to debug errors and warnings in your Expo or React Native app. Developing an application using Expo, it won't be long...
Read more >Usage | FlashList
Check your renderItem hierarchy for components that make use of useState ... If you don't specify this prop, you will get a warning...
Read more >Announcing React Native 0.63 with LogBox
LogBox addresses complaints that errors and warnings were too verbose, ... without having to maintain state manually in a parent component.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I keep coming back to this ticket every year or so. It’s amazing it hasn’t made more noise, the logbox is pretty core functionality for developers and it’s been useless since its inception!
Evan Bacon (expo developer) commented on the issue a couple of months ago:
https://github.com/expo/expo-cli/issues/4236