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.

Can't debug async http calls in typescript files on Ubuntu 18.04

See original GitHub issue

Hi, I don’t know if I raise this issue at the correct repo… Please, let me know if I’m at the wrong place.

Describe the bug Since the last vscode update (1.47), debugger breakpoints (in .ts files) are only hit when I start my web-server, but are not when handling http calls with express.

To Reproduce

  1. start my web server with F5 in vscode.
  2. Put a breakpoint in index.ts and observe the breakpoint being hit.
  3. In api.ts add a console.log(“Hey what’s up I’m a console log please notify I exist”)
  4. In the same file, put a breakpoint on the new console.log you’ve just added.
  5. Observe the console log occuring, but the breakpoint never being hit (instead being greyed out…)
  6. In api.js (the compiled js file of api.ts), put a breakpoint on the exact same line and observe the breakpoint being hit.

The api.ts looks something like this:

router.post('/export', async (req, res) => {
    console.log("Hey what's up I'm a console log please notify I exist")
    res.sendStatus(200)
  })

router is an instance of Router which wa simported from express I believe.

Log File

I added "trace": true to my launch.json but nothing seems to appear in the debug console… Please let me know if I can provide any other info.

VS Code Version: 1.47

Additional context I’m using Ubuntu 18.04

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
franklevasseurcommented, Aug 3, 2020

Yes, it works on the nightly build!! Thanks @connor4312 ! 😄

0reactions
connor4312commented, Jul 31, 2020

Closing this for the moment, feel free to ping me to reopen if you continue to have issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Handle Async Data Loading, Lazy Loading, and Code ...
In this tutorial, you'll handle asynchronous data in React by creating an app that displays information on rivers and simulates requests to Web ......
Read more >
Debug Node.js Async/Await with Typescript+VSCode
I add "smartStep": true to launch.json and debugging the await/async pattern works as desired (using Node v8.4.0). This is my launch.json:
Read more >
Node.js Event-Loop: How even quick Node.js async functions ...
First, let's block the Node.js Event-Loop! Note: Examples below use Node 10.9.0 on an Ubuntu 18.04 VM with 4 cores, running on a ......
Read more >
TypeScript debugging with Visual Studio Code
TypeScript debugging supports JavaScript source maps. To generate source maps for your TypeScript files, compile with the --sourcemap option or set the ...
Read more >
Spring Boot Reference Documentation
It tells Spring that any HTTP request with the / path should be mapped to the ... It is also possible to run...
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