I have hello world program on typescript:
function say(msg: string) {
alert(msg);
for (let i:number=0;i<10;i++)
document.write(i+"<br/>");
}
var msg:string="hello typescript world!";
say(msg);
this code is inside src folder. When I run compiler (tsc) it successfully generates *.js and *.map files and put them inside src folder.Also there is index.html in the root of the project
<html>
<body>
<script type="text/javascript" src="src/hello.js"></script>
</body>
</html>
But when I run debug session in chrome my breakpoints are ignored with the message
Breakpoint ignored because generated code not found (source map problem?)
In the web server logs I 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 to set breakpoint with chrome debugging tool it does stop on breakpoint but doesn't show my js/ts code:
breakpoint added
/src/hello.js.map
file in chrome? 404 not found? - Arg0nbrowse in chrome
? - undefinedhttp://localhost:8080/src/hello.js.map
, does the file show as text, or does it not return the file at all? Might be a file type issue with your server. - Arg0n