Objects cannot be copied from console debugger or logged into console using JSON.stringify()
Description
Objects cannot be copied inside the console debugger (Chrome inspect/DevTools). Even console.log(JSON.stringify(object)) doesnt log the correct string. Both methods copy or log just the first character{ or [
Tried also upgrading RN but the issue is the same as it was for some other versions previously. May be related to https://github.com/facebook/hermes/issues/761
Steps to reproduce
- New RN project
- Start metro with
--experimental-debugger(react-native start --experimental-debugger) - Run
iora(doesnt matter) - After app is opened, press
jin the metro terminal to open the debugger or go to chrome://inspect#devices like in the docs -
console.logan object. Ie:console.log({a:1, b:'string', c: 'test'}) - Try to copy the logged object from the debugger console. Paste it in any text editor or input and see the issue
React Native Version
0.73.1
Affected Platforms
Runtime - Android, Runtime - iOS
Output of npx react-native info
System:
OS: macOS 14.3
CPU: (8) arm64 Apple M1 Pro
Memory: 124.22 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.19.0
path: ~/.nvm/versions/node/v18.19.0/bin/node
Yarn:
version: 1.22.21
path: ~/.nvm/versions/node/v18.19.0/bin/yarn
npm:
version: 10.2.3
path: ~/.nvm/versions/node/v18.19.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.13.0
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- visionOS 1.0
- watchOS 10.2
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode:
version: 15.2/15C500b
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.9
path: /usr/bin/javac
Ruby:
version: 2.7.8
path: /opt/homebrew/opt/[email protected]/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.1
wanted: 0.73.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
info React Native v0.73.5 is now available (your project is running on v0.73.1).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.73.5
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.73.5
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
### Stacktrace or Logs
```text
No error logs, just the described limitation above
Reproducer
https://github.com/krisidmisso/rn-debugger-issue
Screenshots and Videos
No response
| :warning: | Newer Version of React Native is Available! |
|---|---|
| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available - 0.73.5. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
upgrading to the latest stable version doesnt fix the issue, yet
I am using react-native version 0.73.6 This issue is still there.
related to https://github.com/facebook/react-native/issues/43838
@krisidmisso Thanks for raising this. We've confirmed this was a regression 0.73 and will be pursuing a fix.