Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.js.map file contains absolute file path instead of site relative path #496

Closed
wforney opened this issue Aug 21, 2014 · 7 comments
Closed
Assignees
Labels
Bug A bug in TypeScript By Design Deprecated - use "Working as Intended" or "Design Limitation" instead

Comments

@wforney
Copy link

wforney commented Aug 21, 2014

See similar issue here that was in Web Essentials for LESS: madskristensen/WebEssentials2013#1424 (comment)

Should not see C:\some\path\here\whatever.js in the map file. Should be like /here/whatever.js relative path instead. Otherwise source control will be a headache (always modified between different devs).

@danquirk danquirk added the Bug label Aug 21, 2014
@sophiajt sophiajt added this to the TypeScript 1.1 milestone Aug 21, 2014
@sheetalkamat
Copy link
Member

@wforney, What does your repro code for this issue looks like? What are the compiler options you are using to compiler TypeScript. I would need some sample code to look into this. thanks.

@wforney
Copy link
Author

wforney commented Aug 22, 2014

Install VS 2013 Update 3.
Install WebEssentials 2013.
Create a new Web application using MVC.
Add a TypeScript file to the project.
Set TypeScript project options to AMD, ES5, generate maps.
Watch as the maps contain C:\blahblahblah.

The code I'm compiling is irrelevant.

@sheetalkamat
Copy link
Member

I did these steps:
Install VS 2013 Update 3
Create a new Web Application using MVC
Add a typescript file to project (file1.ts)
Set TypeScript project options to AMD, ES5, generate maps

Js file as well as map did not contain c:.... etc.

file1.ts:

class c {
} 

file.js

var c = (function () {
    function c() {
    }
    return c;
})();
//# sourceMappingURL=file1.js.map

file1.js.map

{"version":3,"file":"file1.js","sourceRoot":"","sources":["file1.ts"],"names":["c","c.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;AAAAD,IAADA,SAACA;AAADA,CAACA,IAAA"}

I am going to try with WebEssentials after this.

@sheetalkamat
Copy link
Member

Installed latest WebEssentials and followed the steps and still don't see the issue you are reporting.

These are the same results as without webessentials
file1.ts:

class c {
}

file.js

var c = (function () {
    function c() {
    }
    return c;
})();
//# sourceMappingURL=file1.js.map

file1.js.map

{"version":3,"file":"file1.js","sourceRoot":"","sources":["file1.ts"],"names":["c","c.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;AAAAD,IAADA,SAACA;AAADA,CAACA,IAAA"}

@vvakame
Copy link
Contributor

vvakame commented Aug 27, 2014

$ tsc --version
Version 1.0.1.0
$ cat test.ts
console.log("test");
$ tsc --sourcemap --mapRoot not-exists test.ts
$ echo $?
0
$ cat test.js.map
{"version":3,"file":"test.js","sourceRoot":"","sources":["file:////Users/vvakame/Downloads/test.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC"}

this one?

@wforney
Copy link
Author

wforney commented Aug 28, 2014

I have the map root set to $(ProjectDir) in VS. Could that be causing this?

@sheetalkamat
Copy link
Member

Yes setting of the mapRoot would change how the sourcemaps are emitted. It is used to specify where the maps common directory where the maps would be present when the program would be debugged. You should do this only if have special build step that moves sources, maps or js files around or your app/page needs some special steps of authorization.

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript By Design Deprecated - use "Working as Intended" or "Design Limitation" instead
Projects
None yet
Development

No branches or pull requests

6 participants