Open gabor-seres-sap opened 7 months ago
Is it just the Watch window that doesn't work? Or is the same true for the Locals window?
Is it just the Watch window that doesn't work? Or is the same true for the Locals window?
There is no way to retrieve the value of any variables:
When I switch to RNW 0.71.x then all of the above approaches work fine:
Can we expect to have a fix for 0.72 version?
One addition: in RNW 0.72 https://www.nuget.org/packages/ReactNative.Hermes.Windows/ NuGet package was replaced with https://www.nuget.org/packages/Microsoft.JavaScript.Hermes
This issue seems to be related to this upstream Hermes issue: https://github.com/facebook/hermes/issues/1087.
It's possible this may require getting an update into hermes-windows with this commit: https://github.com/microsoft/hermes-windows/commit/f6aed0e0fe1e106fe22a65e701e35246515f0900
It should also be noted that breakpoints are not lining up to the correct lines with any debuggers with Hermes, which should also be fixed if we integrate a newer hermes build
Adding link to documentation PR that adds workarounds and references this issue: https://github.com/microsoft/react-native-windows-samples/pull/931
Problem Description
We as an SAP development team want to use Hermes direct debugging feature. We have synchronous calls to native module methods so Web debugging is not an option for us. After we upgraded from React Native Windows 0.71.37 to 0.72.24 we faced Hermes direct debugging issue:
Steps To Reproduce
npx react-native@0.72.6 init "RNW_72_24" --version "0.72.6"
cd RNW_72_24
npx react-native-windows-init --overwrite --version "0.72.24" --language "cs" --useHermes
npx react-native run-windows
OR
npx react-native@0.73.0 init "RNW_73_4" --version "0.73.0"
cd RNW_73_4
npx react-native-windows-init --overwrite --version "0.73.4" --language "cs" --useHermes
npx react-native run-windows
Enable direct debugging through developer menu
Choose one of the possible approaches below (a. b. c. or d.)
a. Direct debug RNW apps using the Hermes JS engine with Edge by using the Edge Developer Tools, according to: https://github.com/microsoft/react-native-windows-samples/blob/main/docs/debugging-javascript.md#using-the-edge-developer-tools-1
b. Direct debug RNW apps using the Hermes JS engine with VS Code's built-in Node.js debugger, according to https://github.com/microsoft/react-native-windows-samples/blob/main/docs/debugging-javascript.md#using-visual-studio-code
c. Direct debug RNW apps using the Hermes JS engine with VS Code (v1.85.2) using the React Native Tools extension (v1.12.3), according to https://github.com/microsoft/react-native-windows-samples/blob/main/docs/debugging-javascript.md#using-visual-studio-code-with-the-react-native-tools-1
d. Flipper (0.239.0) We could attach to Hermes using Flipper previously when we had RNW 0.71.37. When RNW version is 0.72.24 or 0.73.4 then React Dev Tools and Logs work fine but Hermes Debugger indicates “Metro is connected but no Hermes apps were found.”
Direct debug RNW apps using the Hermes JS engine with Visual Studio (LTSC 17.6.10) with the debugger from the Node.js development workload according to https://github.com/microsoft/react-native-windows-samples/blob/main/docs/debugging-javascript.md#using-visual-studio-hermes
The content of http://localhost:8081/json
Expected Results
When direct debug Hermes JS engine then scope variables and the watch window should be evaluated properly when breakpoints hit and stop the execution. Similar to direct debug RNW apps using the (default) Chakra JS engine with Visual Studio's built-in Script debugger which works fine using RNW 0.72.24 and 0.73.4, according to https://github.com/microsoft/react-native-windows-samples/blob/main/docs/debugging-javascript.md#using-visual-studio-chakra
CLI version
11.3.7
Environment
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