Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
andidev opened this issue Aug 7, 2017 · 6 comments
Closed

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

andidev opened this issue Aug 7, 2017 · 6 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@andidev
Copy link

andidev commented Aug 7, 2017

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

@andidev
Copy link
Author

andidev commented Aug 9, 2017

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

@andidev andidev closed this as completed Aug 9, 2017
@AlanFoster
Copy link
Contributor

AlanFoster commented Aug 11, 2017

-sigh-

I ran into the exact same problem:

image

@tlloydukdev
Copy link

Me too all of a sudden

@Clarkbaum
Copy link

yeah strange same thing happened to me. thankfully i found this thread so I bothered checking the filters

@dmatora
Copy link

dmatora commented Jul 1, 2018

having same problem, no filtering enabled

@dmatora
Copy link

dmatora commented Jul 4, 2018

solution was to run debug mode (production clears console.log while minifying the code)

@facebook facebook locked as resolved and limited conversation to collaborators Aug 9, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants