question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

console.log("some text") does not get printed to Chrome console

See original GitHub issue

Is this a bug report?

yes

Have you read the Contributing Guidelines?

Yes

Environment

  1. react-native -v: react-native-cli: 2.0.1 react-native: 0.47.1
  2. node -v: v7.10.0
  3. npm -v: 4.2.0
  4. yarn --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:)

  1. Create a new react native project with react-native init NewProject
  2. 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>
    );
  }
}
...
  1. Run react-native run-ios from project root
  2. Enable Remote Debugging
  3. Open the console in Chrome
  4. 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:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

17reactions
andidevcommented, Aug 9, 2017

No issue here, for some reason a console filter where applied. I how no idea how though. Closing this.

12reactions
AlanFostercommented, Aug 11, 2017

-sigh-

I ran into the exact same problem:

image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found