Unable to debug Typescript (source) files in Firefox
Asked Answered
B

3

7

Ok, I created a basic Angular 2 Typescript project using 5 Min QUICKSTART and it's up and running.

My typescript transpiller is configured to create 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 the *.ts files in Chrome and can debug them as well with no issue. But Firefox (and FireFox Developer Edition for that matter) not at all showing the .ts files even though the "Show Original Sources" is checked in the debugger options.

enter image description here

Blasius answered 23/6, 2016 at 10:18 Comment(1)
I see them in FF (47.0) but not in Chrome (51.0.2704.103)Thinia
H
0

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

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

It seams like Firefox can not work with relative paths.

NOTE: Chrome will not work with full path

Humberto answered 23/6, 2016 at 11:53 Comment(0)
F
0

Hi Saurabh Palatkar, Please Follow this below link. It may helpful to fulfill your need. http://www.gamefromscratch.com/post/2014/05/27/TypeScript-debugging-in-Visual-Studio-with-IE-Chrome-and-Firefox-using-Source-Maps.aspx

Feck answered 8/7, 2016 at 9:57 Comment(0)
I
0

You need to add this commented line to your source code

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

Maybe try adding:

"typeCheck": true,
Introgression answered 11/7, 2016 at 7:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.