How to be able to set up breakpoints correctly when using VS Code to debug a TypeScript app run using ts-node in a Docker container? How to be able to set up breakpoints correctly when using VS Code to debug a TypeScript app run using ts-node in a Docker container? typescript typescript

How to be able to set up breakpoints correctly when using VS Code to debug a TypeScript app run using ts-node in a Docker container?


Your are not generating source map for the code. So I updated your tsconfig.json like below

{  "compilerOptions": {    /* Basic Options */    "target": "ES2017",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */    "module": "commonjs",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */    "outDir": "./dist",                        /* Redirect output structure to the directory. */    "rootDir": "./src",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */    "sourceMap": true,    "esModuleInterop": true                   /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */  }}

and now it works like a charm

Debugging working