hermes-profile-transformer icon indicating copy to clipboard operation
hermes-profile-transformer copied to clipboard

error Cannot read properties of undefined (reading 'pid')

Open ThaJay opened this issue 2 years ago • 2 comments

First I followed https://reactnative.dev/docs/hermes/ then https://reactnative.dev/docs/profile-hermes

Recording a Hermes sampling profile seems to succeed (hermes-profile-transformer is in my node-modules at version 0.0.6) Then the command to convert and transfer the Hermes tracing profile fails as follows:

$ npx react-native profile-hermes ./dev
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-trace552874595700445033.cpuprofile
error Cannot read properties of undefined (reading 'pid').
TypeError: Cannot read properties of undefined (reading 'pid')
    at Function.collectProfileEvents (/Users/dev/app/node_modules/hermes-profile-transformer/dist/hermes-profile-transformer.cjs.development.js:315:28)
    at /Users/dev/app/node_modules/hermes-profile-transformer/dist/hermes-profile-transformer.cjs.development.js:517:43
    at async downloadProfile (/Users/dev/app/node_modules/@react-native-community/cli-hermes/build/profileHermes/downloadProfile.js:160:24)
    at async Object.profileHermes [as func] (/Users/dev/app/node_modules/@react-native-community/cli-hermes/build/profileHermes/index.js:28:5)
    at async Command.handleAction (/Users/dev/app/node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.

$ react-native info
info Fetching system and libraries information...
(node:25683) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
System:
    OS: macOS 12.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 857.19 MB / 16.00 GB
    Shell: 5.1.16 - /usr/local/bin/bash
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.15 - /usr/local/bin/yarn
    npm: 8.5.0 - /usr/local/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found // but it is present, API level 30
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8309675
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.14.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.67.2 => 0.67.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

ThaJay avatar Jun 16 '22 13:06 ThaJay