Skip to content

Chrome unable to load the transformed profile: Failed to find browser main thread in trace, some timeline features may be unavailable #53

@ofreyssinet-ledger

Description

@ofreyssinet-ledger

EDIT:
one workaround is to use chrome://tracing to inspect profile


Hello, I'm trying to profile a react-native app, I followed the official documentation on how to pull and transform the Hermes tracing profile.

So once the profile is recorded I'm running this:

npx react-native profile-hermes \
  --sourcemap-path './android/app/build/intermediates/sourcemaps/react/debug/index.android.bundle.packager.map'\
  ~/Downloads

It outputs this:

warn Package expo-modules-core has been ignored because it contains invalid configuration. Reason: "dependency.platforms.ios" must be of type object
info Downloading a Hermes Sampling Profiler from your Android device...
info No filename is provided, pulling latest file
info File to be pulled: sampling-profiler-trace1250977739574747452.cpuprofile
success Successfully converted to Chrome tracing format and pulled the file to /Users/olivier.freyssinet/Downloads/sampling-profiler-trace1250977739574747452-converted.json

And here attached you can file the output .json. I don't know about the formatting but it seems to contain actual data that reflects what's going on in my app, so then it's just a matter of parsing it I guess.

So then I try to load it in the performance tab of Chrome Version 109.0.5414.119 (Official Build) (arm64)
It seems to be parsing the whole file but then nothing is displayed and I get the following error in the console (three times):

17:30:02.957 Failed to find browser main thread in trace, some timeline features may be unavailable
17:30:02.958 Failed to find browser main thread in trace, some timeline features may be unavailable
17:30:02.982 Failed to find browser main thread in trace, some timeline features may be unavailable

Another person who is trying on a Linux computer gets this slightly more explicit error:

Error parsing trace data: no TracingStartedInBrowser event found
Screen.Recording.2023-01-31.at.17.40.50.mov

Hermes version:

"hermes-engine": "0.11.0"

react-native info output

System:
    OS: macOS 12.5.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 96.39 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.0 - /usr/local/bin/node
    Yarn: 1.22.18 - /opt/homebrew/bin/yarn
    npm: 8.5.5 - /usr/local/bin/npm
    Watchman: 2022.09.19.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK:
      API Levels: 29, 30, 31, 32, 33
      Build Tools: 28.0.3, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0
      System Images: android-31 | Google APIs ARM 64 v8a, android-32 | Google APIs ARM 64 v8a, chromeos-67 | Chrome OS 67
      Android NDK: 22.1.7171670
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8309675
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.15 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: ^7.0.1 => 7.0.4 
    react: ^17.0.2 => 17.0.2 
    react-native: 0.68.5 => 0.68.5 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Thanks in advance for any help! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions