Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: VSCode debugging #399

Merged
merged 5 commits into from
Nov 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,30 @@ argv: [ 'hello' ]
</a>
</p>

### VS Code Debugging
You can setup debugging in VS Code by adding the --inspect flag to the tsx command
```sh
$ tsx --inspect ./file.ts
Copy link
Owner

@privatenumber privatenumber Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried this out. Do you mean --inspect-brk here?

Seems --inspect only works for long-running services like servers?

```

To be able to attach the debugger to the port that the --inspect argument opens, add the following to your .vscode/launch.json file ([more info](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_attaching-to-nodejs))

```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Process",
"type": "node",
"request": "attach",
"port": 9229
}
]
}
```

You can now start debugging by clicking F5 (or Run -> Start Debugging), and selecting the "Attach to Process"-option.

## Support

If there's a problem you're encountering or something you need help with, don't hesitate to take advantage of my [_Priority Support_ service](https://github.com/sponsors/privatenumber) where you can ask me questions in an exclusive forum. I'm well equppied to assist you with this project and would be happy to help you out! 🙂
Expand Down