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

[0.77] DevTools Profiler/Components doesn't initialize with JS Dev Mode off #49180

Open
MorganTrudeau opened this issue Feb 4, 2025 · 7 comments
Assignees
Labels
Debugging Issues related to React Native DevTools or legacy JavaScript/Hermes debugging Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.

Comments

@MorganTrudeau
Copy link

MorganTrudeau commented Feb 4, 2025

Description

I have upgraded to react-native 0.77.0 to use the new devtools which looks awesome. Unfortunately when I try to measure performance on my app with JS Dev Mode disabled the devtools profiler won't connect. Both the Profiler and Components tab will not load. Hope I'm just missing something. This wasn't working on my project so I tried with a fresh init react-native project and found the same result.

Note: This is working with JS Dev Mode enabled.

Thanks for any information!

Steps to reproduce

For me the reproduction steps are:

  1. npx @react-native-community/cli@latest init AwesomeProject
  2. yarn start
  3. Run app on android
  4. Shake device -> Settings -> Turn JS Dev Mode off
  5. Hit "j" in terminal to open devtools
  6. Click on Profiler

Expected Result: Profiler initializes and can be used

Actual Result: Profiler fails with error "Failed to wait for initialization: it took too long"

React Native Version

0.77.0

Output of npx react-native info

System:
  OS: macOS 14.5
  CPU: (10) x64 Apple M1 Pro
  Memory: 20.52 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: 4.3.1
    path: ~/.nvm/versions/node/v18.19.0/bin/yarn
  npm:
    version: 10.2.3
    path: ~/.nvm/versions/node/v18.19.0/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/morgantrudeau/.rvm/rubies/ruby-2.7.6/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    API Levels:
      - "26"
      - "27"
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
      - "33"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 28.0.3
      - 29.0.2
      - 29.0.3
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 34.0.0
      - 35.0.0
    System Images:
      - android-27 | Google APIs ARM 64 v8a
      - android-31 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23726.103.2422.12816248
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/morgantrudeau/.rvm/rubies/ruby-2.7.6/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.77.0
    wanted: 0.77.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Screenshots and Videos

No response

@MorganTrudeau MorganTrudeau added Debugging Issues related to React Native DevTools or legacy JavaScript/Hermes debugging Needs: Triage 🔍 labels Feb 4, 2025
@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Feb 4, 2025
@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@cortinico
Copy link
Contributor

cortinico commented Feb 5, 2025

Potentially related to #49158

@huntie
Copy link
Member

huntie commented Feb 5, 2025

"Turn JS Dev Mode off"

Blimey, we learn about a new buried dev feature every week 🤣. Will look into this.

@huntie huntie changed the title Devtools Profiler doesn't initialize [0.77] DevTools Profiler/Components doesn't initialize with JS Dev Mode off Feb 5, 2025
@MorganTrudeau
Copy link
Author

@react-native-bot This happens in RNTesterPlayground.js with no changes and following supplied reproduction steps.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Feb 5, 2025
@MorganTrudeau
Copy link
Author

Potentially related to #49158

I have run into this same heap snapshot in my own project, but this doesn't happen in a fresh project.

@huntie
Copy link
Member

huntie commented Feb 5, 2025

Note: This is working with JS Dev Mode enabled.

This part is critical, and this is expected behaviour. The React DevTools panels won't function if there is no development bundle running.

  • We'll look at introducing an error state in the UI to make this more clear.
  • Potentially, the "JS Dev Mode" toggle (implemented on Android only) should be removed.

@MorganTrudeau
Copy link
Author

MorganTrudeau commented Feb 5, 2025

Note: This is working with JS Dev Mode enabled.

This part is critical, and this is expected behaviour. The React DevTools panels won't function if there is no development bundle running.

  • We'll look at introducing an error state in the UI to make this more clear.
  • Potentially, the "JS Dev Mode" toggle (implemented on Android only) should be removed.

Interesting, this link https://reactnative.dev/docs/profiling says to turn dev mode off. Is this referring to something else?

Can you advise me on how to turn development mode off and still profile? Thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Debugging Issues related to React Native DevTools or legacy JavaScript/Hermes debugging Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.
Projects
None yet
Development

No branches or pull requests

4 participants