facebook / metro

🚇 The JavaScript bundler for React Native
https://metrobundler.dev
MIT License
5.23k stars 626 forks source link

RN64 Hermes iOS: No console.logs anymore: "JavaScript logs will appear in your environment console" #635

Closed mrousavy closed 3 years ago

mrousavy commented 3 years ago

Since I upgraded from RN 0.63 to RN 0.64 (rc3) and enabled Hermes I cannot see my console.logs anymore.

Screenshot 2021-02-09 at 14 05 40

The same thing in Flipper Logs.

Out put of npx react-native --version:

5.0.1-alpha.1

Probably related

alloy commented 3 years ago

@mrousavy I have no clear ideas offhand, but would suggest you start debugging from here, which is where the logs come out of the engine.

mrousavy commented 3 years ago

@alloy I've tried tracking it down like this:

I'm thinking if this maybe has something to do with Reanimated, since that also creates a separate Runtime instance - maybe there are conflicts introduced by this?

mrousavy commented 3 years ago

Okay the code I linked doesn't even get called. It should get called with RCTJSIExecutorRuntimeInstaller, but in RCTCxxBridge.mm it enters this if, causing the installer to get skipped.

Screenshot 2021-02-09 at 14 41 41

I believe this has something to do with how react-native-navigation sets up the bridge (see https://github.com/wix/react-native-navigation/pull/6835), still investigating.. 🕵️

mrousavy commented 3 years ago

Resolved! It was a reanimated issue. See: https://github.com/software-mansion/react-native-reanimated/pull/1704

alloy commented 3 years ago

Ah I see, good sleuthing :clap:

KingAmo commented 3 years ago

still have this problem with react-native-reanimated v2.0.0, hermes enabled in iOS