microsoft / microsoft/react-native-windows
Can't direct debug Hermes when consuming the Microsoft.ReactNative nuget packages
@vmoroz is already working on this.
Since Feb 23, 2023.
- Dominant language
- C++
- Stars
- 17.3k
- Forks
- 1.2k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 33
Description
Problem Description
In order for Hermes direct debugging to work, the RNW code needs to set up the Hermes Inspector (which connects to Metro for source maps). However the code in Microsoft.ReactNative is #ifdef HERMES_ENABLE_DEBUGGER:
This compile time flag is set by the targets file for the hermes-windows nuget (when building debug or by setting a property to build in release flavor too):
However this means its only applied when building RNW from source. The RNW nuget packages are built in release flavor.
Note, this is blocked by the fact that you can't even use Hermes with the RNW nugets at all (see #11251) but even if that were fixed, there'd still be extra work to allow direct debugging since it's behind HERMES_ENABLE_DEBUGGER.
Steps To Reproduce
- Build a new RNW app with the experimental nugets and hermes
- Run the new app with direct debugging enabled
Expected Results
Able to connect a direct debugger.
CLI version
npx react-native --version
Environment
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.25300
CPU: (24) x64 AMD Ryzen Threadripper PRO 3945WX 12-Cores
Memory: 51.33 GB / 63.86 GB
Binaries:
Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions: 10.0.18362.0, 10.0.19041.0, 10.0.22000.0, 10.0.22621.0
IDEs:
Android Studio: Not Found
Visual Studio: 16.11.33214.272 (Visual Studio Enterprise 2019), 17.4.33213.308 (Visual Studio Enterprise 2022)
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.0 => 0.71.0
react-native-windows: 0.71.1 => 0.71.1
npmGlobalPackages:
*react-native*: Not Found
Target Platform Version
10.0.19041
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2022
Build Configuration
Debug
Snack, code example, screenshot, or link to a repository
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.