Cannnot debug TypeScript files
See original GitHub issueIt seems that debugging TypeScript files is not possible. My simplified project structure looks as follows:
│ package.json
│ template.yml
│ tsconfig.json
│ webpack.config.js
│
├───.aws-sam
│ └───build
│ │ template.yaml
│ │
│ └───MyFunction
│ app.js
│ app.js.map
│
├───.vscode
│ launch.json
│
└───src
└───my-function
│ app.ts
tsconfig.json:
{
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"allowJs": true,
"checkJs": true,
"sourceMap": true,
"noImplicitAny": false,
"strict": true,
"esModuleInterop": true
},
"include": ["src/**/*.ts", "src/**/*.js"]
}
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "MyFunction",
"type": "node",
"request": "attach",
"address": "localhost",
"port": 5858,
"localRoot": "${workspaceRoot}/.aws-sam/build/MyFunction",
"remoteRoot": "/var/task",
"protocol": "inspector",
"stopOnEntry": false,
"outFiles": ["${workspaceRoot}/.aws-sam/build/MyFunction/app.js"],
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///./~/*": "${workspaceRoot}/node_modules/*",
"webpack:///./*": "${workspaceRoot}/src/my-function/*",
"webpack:///*": "*"
}
}
]
}
In my app.ts file I have appropriate import import "source-map-support/register";
With this configuration, setting a breakpoint in app.ts results with nothing during debugging session. What can be an issue?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
TypeScript debugging with Visual Studio Code
Debugging TypeScript. Visual Studio Code supports TypeScript debugging through its built-in Node.js debugger and Edge and Chrome debugger.
Read more >Can't debug current typescript file in VS Code because ...
The debugger is working if given abseloute paths. mapRoot is not set - I will edit the original question so the tsconfig.json is...
Read more >Cannot debug .ts files (instead steps into .js) when ... - GitHub
When I debug in VS Code I can set a breakpoint in a .ts file and the debugger will stop at that location,...
Read more >How to Debug TypeScript Files with Chrome Browser - Medium
This is a really useful way to debug TypeScript files, and it isn't difficult at all, let's debug TypeScript files and find bugs!...
Read more >Debug a JavaScript or TypeScript app - Visual Studio (Windows)
With your project open in Visual Studio, open a server-side JavaScript file (such as server.js), click in the gutter to set a breakpoint:....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m also having trouble with this. @buggy Could you provide some clarification on how
source-map-support
should be incorporated?@buggy I got the mentioned solution to work which is start SAM with
and then in VScode I start the debugger. However it only worked with JS files. For TS file it wouldn’t stop at the break points
I got the following error when I try to debug lambas written in typescript