[0.61.0] Debugging console is not link log to the source
See original GitHub issueOn 0.61.0
, every console log is now always pointing to setUpDeveloperTools.js:73
instead of pointing to the source. Not sure if it related to these changes 🤔 (https://github.com/facebook/react-native/commit/81ec2112a15e3d66b7973f0e1aaa8986fcca753f#diff-8863a34349d2a00986749efcf471649c)
It used to work fine on 0.60.4
.
React Native version:
System:
OS: macOS Mojave 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 540.27 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.3.1 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
Android SDK:
API Levels: 15, 19, 22, 23, 24, 25, 26, 27, 28
Build Tools: 27.0.3, 28.0.0, 28.0.2, 28.0.3, 29.0.0
System Images: android-22 | Google APIs Intel x86 Atom, android-24 | Google APIs Intel x86 Atom, android-P | Google Play Intel x86 Atom, android-Q | Google APIs Intel x86 Atom
Android NDK: 19.2.5345600
IDEs:
Xcode: 11.0/11A420a - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.0 => 0.61.0
npmGlobalPackages:
react-native-cli: 2.0.1
Steps To Reproduce
- Launch application in debug mode.
- Add
console.log
somewhere in the code. - Open the debugger console.
- Every log is coming from
setUpDeveloperTools.js:73
Describe what you expected to happen:
The debugger console should link the log to the source file & number of lines.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:27
- Comments:18 (2 by maintainers)
Top Results From Across the Web
Chrome: console.log, console.debug are not working
log statements started showing up in the console. Till the time Info level was selected, they were not getting shown.
Read more >Debugging - React Native
If you're using Create React Native App or Expo CLI, console logs already appear in the same terminal output as the bundler. Debugging...
Read more >Using console.log() debugging in Visual Studio Code
In the video I use a project I have open with a launch.json file already defined, which means it opens the correct URL...
Read more >Fix JavaScript errors that are reported in the Console
Click the link to the webpage and line of code where the error occurs, to open the Sources tool. That is, click the...
Read more >Debugging in Visual Studio Code
A Logpoint is a variant of a breakpoint that does not "break" into the debugger but instead logs a message to the console....
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 Free
Top 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
In the meantime you can “patch” your
/node_modules/react-native/Libraries/Core/setUpDeveloperTools.js
In line 57
replace
if (!Platform.isTesting) {
by
if (!Platform.isTesting && global.nativeLoggingHook) {
and source will be showed up until next RN’s release
working for me 💯 , thanks you