console.log("some text") does not get printed to Chrome console
See original GitHub issueIs this a bug report?
yes
Have you read the Contributing Guidelines?
Yes
Environment
react-native -v
: react-native-cli: 2.0.1 react-native: 0.47.1node -v
: v7.10.0npm -v
: 4.2.0yarn --version
: 0.27.5
Then, specify:
- Target Platform: iOS and Android
- Development Operating System: macOS 10.12.6
- Build tools: Chrome 60.0.3112.90
Steps to Reproduce
(Write your steps here:)
- Create a new react native project with
react-native init NewProject
- Add a console print to index.ios.js and index.android.js in the render method, e.g.
...
export default class NewProject extends Component {
render() {
console.log("This should be printed in console!");
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}
...
- Run
react-native run-ios
from project root - Enable Remote Debugging
- Open the console in Chrome
- Refresh app and nothing gets printed
Expected Behavior
In step 6 the text This should be printed in console!
should have been printed to Chrome console
Actual Behavior
Nothing gets printed to console. I think the issue may be related to the Chrome release since it was after an upgrade it stopped working.
Reproducible Demo
https://github.com/andidev/react-native-console-log-bug-example-project
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Chrome: console.log, console.debug are not working
so first close all tabs restart chrome and in a new tab just typ1 console.log('hi'); if it prints that then it confirms that...
Read more >Log messages in the Console - Chrome Developers
Log messages in the Console · Set up the demo and DevTools · View messages logged from JavaScript · View messages logged by...
Read more >Log messages in the Console tool - Microsoft Edge ...
The Console object has several levels of message-logging methods: console.log - Prints the text to the console as a log message. console.info - ......
Read more >How to print debug messages in the Google Chrome ...
Click on F12 after running the script and it opens the Developer Tools, navigate to the Console tab, which will be on the...
Read more >JavaScript Console.log() Example – How to Print to the ...
Just open the console, Ctrl+Shift+K or F12 , and in the top right you will see a button that says "Switch to multi-line...
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
No issue here, for some reason a console filter where applied. I how no idea how though. Closing this.
-sigh-
I ran into the exact same problem: