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.

Cannot breakpoint source TS file while debugging from VSCode

See original GitHub issue

I am having an issue where I cannot set breakpoints in the original source of my code files when using keystone dev from VSCode

I have the following in my launch.json

        {
            "type": "pwa-node",
            "request": "launch",
            "name": "keystone:dev",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}\\node_modules\\@keystone-next\\keystone\\bin\\cli.js",
            "cwd": "${workspaceFolder}\\packages\\server",
            "args": [
                "dev"
            ],
            "sourceMaps": true,
            "sourceMapPathOverrides": {
                "webpack-internal:///*": "${workspaceFolder}/packages/server/.keystone/admin"
            },
            "outFiles": [
                "${workspaceFolder}/packages/server/.keystone/admin/**/*.js",
                "!**/node_modules/**"
            ]
        },

and setting a debug point in keystone.ts near the start will breakpoint, but will break on what appears to be the transpiled JavaScript in a new tab, even though the file name and path are the same as the original source.

This is also true of extra code I have written that is used in the keystone.ts, namely extensions to the ExpressJS app via server.extendExpressApp in the config.

Does anyone have a working launch.json that lets them debug the original source?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aaronpowellcommented, Jan 31, 2022

@xenobytezero Thanks. I can repo too.

I’ll have a dig around and reach out to the VS Code team as well

1reaction
xenobytezerocommented, Jan 30, 2022

Pushed change to the Github, updated to latest versions of everything, issue is persisting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript debugging with Visual Studio Code
Whenever you set a breakpoint in the original source, VS Code tries to find the generated source by searching the files specified by...
Read more >
how to debug typescript files in visual studio code
Just open or re-focus the file and then press F5 (Start Debugging). If multiple debug environments exist like Chrome and Node.js, select the...
Read more >
How to debug TypeScript with VS Code - Philipp Kief - Medium
This article explains how to set up a small TypeScript project and debug it with VS code. It shows how to configure and...
Read more >
Troubleshoot Breakpoints in the Visual Studio Debugger
If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the...
Read more >
Debugging Angular with VS Code & Setting Breakpoints
This video covers just how simple the process is to launch debug and set breakpoints in VS Code. Tutorial source code: ...
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