react-native: [0.61.0] Debugging console is not link log to the source
On 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.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 27
- Comments: 18 (2 by maintainers)
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
Looks like this has been fixed via https://github.com/facebook/react-native/commit/42ac240bceb104474494c6007df0089baec00f7a. I will cherry-pick the fix.
Same problem on version 0.61.1
^^^ RN 0.61.3 still didnt updated this fix.
the same thing happens to me, please a solution! I’m using the Google Chrome browser…
Just FYI to everybody, it seems this will be fixed on the next release.
https://github.com/facebook/react-native/pull/26883
Same problem here.
Have the same issue in version “react-native”: “0.61.1”