question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

šŸš€ Feature Request: Add a `.vscode/launch.json` during project creation

See original GitHub issue

Hi,

Basically, I donā€™t know how to debug a worker with VS Code. When clicking ā€œRun/Debugā€ in VS Code, it basically invokes what is configured in .vscode/launch.json. I just have no idea what should be written there since the dev environment is wrapped by wrangler.

Since most of the people are using VS Code and they probably have a similar problem, I assume it would be a nice addition and improving developer experience significantly.

Iā€™ve also posted a related thread here: https://community.cloudflare.com/t/how-to-debug-use-breakpoints-with-vs-code/423775

Thanks for consideration.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dagneliescommented, Oct 4, 2022

I tried it with the configuration given in the screenshot:

 {
    "type": "node",
    "request": "attach",
    "name": "Attach to remote",
    "address": "127.0.0.1",
    "port": 9229
}

ā€¦but in my case it did not work. I got a couple of issues.

Somehow the debugger has problems attaching. Sometimes it does, sometimes it does not.

A common error showing up in wrangler is:

X [ERROR] Tried to open a new devtools window when a previous one was already open.

While the debugger complains that its session has ended:

image

I managed to get one step ahead and get it briefly attached, just to see that the breakpoints still arenā€™t working. This time the message looks as follows:

image

It suggested to add "sourceMap": true to the tsconfig.json, but even after this change it does not appear to work.

Back to ā€œconsole.logā€ debugging šŸ¤”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging in Visual Studio Code
VS Code keeps debugging configuration information in a launch.json file located in a .vscode folder in your workspace (project root folder) or in...
Read more >
Configure launch.json for C/C++ debugging in Visual Studio ...
Visual Studio Code generates a launch.json (under a .vscode folder in your project) with almost all of the required information.
Read more >
Debug Node.js Apps using Visual Studio Code
Debugging configurations are stored in a launch.json file located in your workspace's .vscode folder. An introduction into the creation and use of debuggingĀ ......
Read more >
Visual Studio Code documentation search
Visual Studio Code generates a launch.json (under a .vscode folder in your project) with almost all of the required information.
Read more >
User and Workspace Settings - Visual Studio Code
For example, @feature:explorer shows settings of the File Explorer. ... When you add a Workspace Settings settings.json file to your project or sourceĀ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found