Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
103
rated 0 times [  105] [ 2]  / answers: 1 / hits: 16943  / 8 Years ago, thu, august 25, 2016, 12:00:00

I'm using webstorm 2016.2, angular-cli, webpack2.
In the photo, I can't create a breaking point on lines 19,20,22,23.
When I create on line 21, the console does not print what I told him in line 19.



I'm seeing ts file that should be debugged but It seems I'm debugging other file or the js file that I do not have any access to.



I would like to debug the ts file if possible and if not, the js file.



enter



angular-cli.json:



{
project: {
version: 1.0.0-beta.11-webpack.2,
name: store-app-02
},
apps: [
{
main: src/main.ts,
tsconfig: src/tsconfig.json,
mobile: false
}
],
addons: [],
packages: [],
e2e: {
protractor: {
config: config/protractor.conf.js
}
},
test: {
karma: {
config: config/karma.conf.js
}
},
defaults: {
prefix: app,
sourceDir: src,
styleExt: css,
prefixInterfaces: false,
lazyRoutePrefix: +,
styles: [
../node_modules/bootstrap/dist/css/bootstrap.min.css
]
}
}


tsconfig.json:



{
compilerOptions: {
declaration: false,
emitDecoratorMetadata: true,
experimentalDecorators: true,
mapRoot: ./,
module: es6,
moduleResolution: node,
outDir: ../dist/out-tsc,
sourceMap: true,
target: es5,
typeRoots: [
../node_modules/@types
],
types: [
core-js
]
}
}

More From » debugging

 Answers
10

your ts code is converted to js during compile time and eventually it is javascript file which get loaded in web browser. your browser doesn't know about typescript.



ts ---> js (es5).



When debugger runs it is going to run respective compiled js file. if there is any error it points to js file and you are mapped to ts file line-number (where error occured) with help of .d.ts internally.



if you want to debug, you can use karma test runner or use visual studio code which exclusively provides debug option.


[#60921] Tuesday, August 23, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
marint

Total Points: 550
Total Questions: 105
Total Answers: 124

Location: Zambia
Member since Sat, Oct 31, 2020
4 Years ago
;