VS Code ignoring break points when debugging typescript program -
i have hello world program on typescript:
function say(msg: string) { alert(msg); (let i:number=0;i<10;i++) document.write(i+"<br/>"); } var msg:string="hello typescript world!"; say(msg);
this code inside src folder. when run compiler (tsc) generates *.js , *.map files , put them inside src folder.also there index.html in root of project
<html> <body> <script type="text/javascript" src="src/hello.js"></script> </body> </html>
but when run debug session in chrome breakpoints ignored message
breakpoint ignored because generated code not found (source map problem?)
in web server logs can see following line:
"get /src/hello.js.map" "undefined"
tsconfig.json:
{ "compileroptions": { "sourcemap":true, "target": "es5", "module": "commonjs", "noimplicitany": false } }
launch.json:
{ "version": "0.2.0", "configurations": [ { "type": "chrome", "request": "launch", "name": "debug in chrome", "url": "http://localhost:8080", "webroot": "${workspaceroot}" } ] }
update: when trying set breakpoint chrome debugging tool stop on breakpoint doesn't show js/ts code:
breakpoint added
it looks there issue vs code.i started new project same launch.json,tsconfig.json , source code , debugging ok in chrome!then copied initial project , debugging ok too.
Comments
Post a Comment