Skip to content
This repository has been archived by the owner on Feb 16, 2019. It is now read-only.

source maps not working in example project? #11

Closed
marcvk opened this issue Aug 7, 2016 · 5 comments
Closed

source maps not working in example project? #11

marcvk opened this issue Aug 7, 2016 · 5 comments

Comments

@marcvk
Copy link

marcvk commented Aug 7, 2016

Hi,

I can't get the source maps to work properly in Chrome in my own project. Trying out the example project they don't appear to be working there either. Chrome can't locate the ts files at all and shows the breakpoints in the generated js files.

Kind regards,
Marc van Kempen.

@joost-de-vries
Copy link
Owner

From the top of my head: there's a tsc configuration called sourceRoot. That will be used to set the url to the sourcemaps in the js files. Chrome will use that to request the sourcemap from the play server.
You're right; it would be nice to set that correctly in the activator project. If you find out the correct value pls let me know and I'll update the play-angular2-typescript project. Or you can provide a pull request.

@joost-de-vries
Copy link
Owner

Actually the tsc setting is called mapRoot. See ts handbook
Since it seems to be an issue of TS knowledge and I haven't heard from you I'm closing this.

@SlevinBE
Copy link

Hi Joost,

I ran into a similar issue. My project is based on the example project.
I tried setting the mapRoot to "assets", but when I look at the contents of the generated source map file it contains an absolute folder path.

@joost-de-vries
Copy link
Owner

@SlevinBE I'm using the following tsconfig.json settings.

    "sourceMap": true,
    "mapRoot": "/assets",
    "sourceRoot": "/assets",

If you don't start with a slash it is interpreted as a relative path and tsc prefixes the file location apparently.
This is purely tsc. Not sbt-typescript.

@SlevinBE
Copy link

combining the mapRoot and sourceRoot, with a leading "/", like you showed did the trick. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants