Chrome detects but does not use Typescript source maps
For a trivial example source file, Chrome is indicating that it has detected the generated source map, but won't allow me to step through or set breakpoints in the .ts file. Debugging the generated javascript works fine. This is on Windows 10, latest version of Chrome (63.0.3239.132) and Typescript (2.6.2).
// do_nothing.ts
function add(x: number, y: number) : number
{
return x+y;
}
console.log(`Here's a big old scoop of nothing.`);
console.log(`4 + 8 = `, add(4, 8));
Compiler is definitely generating the source map, and all three files are in the same directory. The source mapping URL in the generated .js file is fine.
tsc --sourceMap true do_nothing.ts
Chrome gives "Source Map detected" info box. I can load the do_nothing.ts file through the debugger's "Filesystem" tab but am unable to set breakpoints and never get an execution cursor. (Code executes in node fine, BTW.)
I'm sure this is just a brain fart on my part but it's driving me nuts.
EDIT: Predictably, these exact same steps work fine on OS X, using exactly the same .js and .map files.
链接地址: http://www.djcxy.com/p/66996.html