In my current project using Visual Studio Code version 1.17, I am focusing on debugging the current typescript file. As part of my setup, I have a build task in place which generates a corresponding javascript file structure like so:
src/folder1/folder2/main.ts
src/folder1/folder2/main.js
To achieve this debugging objective, I attempted to configure the launch.json file as follows:
{
"type": "node",
"request": "launch",
"name": "Current File",
"program": "${file}",
"console": "integratedTerminal",
"outFiles": [
"${workspaceFolder}/${fileDirname}**/*.js"
]
}
Unfortunately, running into an error message stating:
Cannot launch program '--full-path-to-project--/src/folder1/folder2/main.ts' because corresponding JavaScript cannot be found.
Despite the existing of the respective JavaScript file!
Here's a glimpse at my tsconfig.json setup:
{
"compileOnSave": true,
"compilerOptions": {
"target": "es6",
"lib": [
"es2017",
"dom"
],
"module": "commonjs",
"watch": true,
"moduleResolution": "node",
"sourceMap": true
// "types": []
},
"include": [
"src",
"test"
],
"exclude": [
"node_modules",
"typings"
]}