For someone else struggling with TypeScript debugging in WebStorm / IDEA, I had similar frustrations as an OP (possibly for various reasons). My problem was that I did not set the working directory to the dist folder in the node startup configuration. I run tests in Jest and assume that the working directory should be the root of my project. Set it to dist and debugging will start working!
Additional Information...
Src source .ts files
Typescript version: 2.0.3
tsconfig.json file:
{ "compilerOptions": { "jsx": "react", "module": "commonjs", "noImplicitAny": false, "outDir": "dist", "preserveConstEnums": true, "removeComments": true, "sourceMap": true, "target": "es6", "moduleResolution": "node" }, "exclude": [ "node_modules", "dist" ] }
Jest configuration (in package.json ):
"jest": { "scriptPreprocessor": "<rootDir>/node_modules/ts-jest/dist/preprocessor.js", "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)$", "moduleFileExtensions": [ "ts", "tsx", "js" ] }
Run configuration ...
Working Directory: <project_root>/dist
Javascript File: ../node_modules/jest-cli/bin/jest.js
Application Settings: --runInBand
Hope this helps!
jugglingcats
source share