Failed to debug Typescript (source) files in Firefox

Ok, I created a basic Angular 2 Typescript project using 5 Min QUICKSTART and it works.

My Typescript transpiler is configured to create the source map:

tsconfig.js

{ "compilerOptions": { "target": "es5", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": false } } 

Now I can see * .ts files in Chrome and also debug them without problems. But Firefox (and FireFox Developer Edition, for that matter) doesn’t show .ts files at all, even if Show Source Sources is checked in the debugger options. p>

enter image description here

+7
javascript firefox typescript firefox-developer-tools firefox-developer-edition
source share
3 answers

It will work for Firefox if you specify sourcemap with the full path in the compiled js file:

 //# sourceMappingURL=http://localhost:3000/app/app.component.js.map 

It looks like Firefox cannot work with relative paths.

NOTE. Chrome will not work with the full path.

0
source share
0
source share

You need to add this commented line to the source code.

 //# sourceMappingURL=http://example.com/path/to/your/sourcemap.map 

Perhaps try adding:

 "typeCheck": true, 
0
source share

All Articles