microsoft / react-native-windows-samples

A repository showcasing React Native samples and templates for Windows, macOS, and Surface Duo.
https://microsoft.github.io/react-native-windows/
MIT License
477 stars 198 forks source link

Direct Debugging config created for VS Code doesn't match documentation #928

Closed Yajur-Grover closed 6 months ago

Yajur-Grover commented 7 months ago

Page url

https://microsoft.github.io/react-native-windows/docs/debugging-javascript#direct-debugging

Problem Description

When setting up JavaScript direct debugging for VS Code (Hermes), the output in the launch.json file when adding a 'Node.js' or 'Node.js: Attach' configuration does not match the expected output in the documentation, as shown below:

Node.js:

    {
        "type": "node",
        "request": "launch",
        "name": "Launch Program",
        "skipFiles": [
            "<node_internals>/**"
        ],
        "program": "${workspaceFolder}\\index.js"
    }

Node.js (Attach):

    {
        "name": "Attach",
        "port": 9229,
        "request": "attach",
        "skipFiles": [
            "<node_internals>/**"
        ],
        "type": "node"
    }

Expected output:

    {
        "name": "Attach",
        "port": 8081,
        "request": "attach",
        "skipFiles": [
            "<node_internals>/**"
        ],
        "outFiles": [
            "${workspaceFolder}/**/*"
        ],
        "type": "node"
    }

After adding the config, I just replaced it with what the expected config was according to the documentation, but not sure why there is a difference in output.

chrisglein commented 6 months ago

Related: https://github.com/microsoft/vscode/issues/206581

Yajur-Grover commented 6 months ago

Related: microsoft/vscode#206581

Issue posted on the React Native Tools repo detailing direct debugging errors: https://github.com/microsoft/vscode-react-native/issues/2117

jonthysell commented 6 months ago

The docs show what you need to set to make it work, not necessarily what (incorrect) config got generated.