You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm a maintainer of React Native Tools VS Code extension. The extension is used for debugging React Native applications. Under the hood the extension uses vscode-js-debug debugger to debug javascript apps.
Describe the bug
While debugging React Native applications, we found out that js-debug sends the CDP request to a debuggee to get some data for telemetry. js-debug keeps sending that request, in case the debuggee returns process not defined string. Due to the peculiarities of debugging React Native Hermes applications the debuggee always returns process not defined string as a result.
[Reply From Debugger To Target] {
"id": 1043,
"method": "Runtime.evaluate",
"params": {
"contextId": 1,
"returnByValue": true,
"expression": "typeof process === 'undefined' || process.pid === undefined ? 'process not defined' : ({ processId: process.pid, nodeVersion: process.version, architecture: process.arch })\n//# sourceURL=eval-8907f309.cdp\n"
}
}
[Reply From Target To Debugger] {
"result": {
"result": {
"type": "string",
"value": "process not defined"
}
},
"id": 1043
}
Therefore, js-debug sends the Runtime.evaluate request in an infinite loop here.
This behavior doesn't break debugging, but it could reduce performance.
It might make sense to add several retries to get process data in gatherTelemetryFromCdp function (e.g. like here) to prevent infinite sending of the CDP request.
To Reproduce
Steps to reproduce the behavior:
Prepare the development environment for React Native Android apps using this guide
Create a plain RN app using the command npx react-native init AwesomeProject
Enable Hermes engine for Android following the guide
Launch the RN app using the command npx react-native run-android
Open the project in VS Code and create the debugging configuration:
Attach to the application using the created debugging configuration
After that js-debug should attach to the app. Breakpoint won't work since some additional processing is need (this is implemented in React Native Tools extension), but debugging console should work correctly
Then you can set a breakpoint in gatherTelemetryFromCdp function here, and it will be reached over and over again after the successful attachment
Hello,
I'm a maintainer of React Native Tools VS Code extension. The extension is used for debugging React Native applications. Under the hood the extension uses
vscode-js-debug
debugger to debug javascript apps.Describe the bug
While debugging React Native applications, we found out that
js-debug
sends the CDP request to a debuggee to get some data for telemetry.js-debug
keeps sending that request, in case the debuggee returnsprocess not defined
string. Due to the peculiarities of debugging React Native Hermes applications the debuggee always returnsprocess not defined
string as a result.Therefore,
js-debug
sends theRuntime.evaluate
request in an infinite loop here.This behavior doesn't break debugging, but it could reduce performance.
It might make sense to add several retries to get process data in
gatherTelemetryFromCdp
function (e.g. like here) to prevent infinite sending of the CDP request.To Reproduce
Steps to reproduce the behavior:
npx react-native init AwesomeProject
npx react-native run-android
js-debug
should attach to the app. Breakpoint won't work since some additional processing is need (this is implemented in React Native Tools extension), but debugging console should work correctlygatherTelemetryFromCdp
function here, and it will be reached over and over again after the successful attachmentLog Files: vscode-debugadapter-c33e8880.json.gz, CDPlogs.txt
VS Code Version: 1.55.2
The text was updated successfully, but these errors were encountered: