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

TS 3.0 generates invalid path for sourceMappingURL #26530

Closed
saschanaz opened this issue Aug 18, 2018 · 1 comment
Closed

TS 3.0 generates invalid path for sourceMappingURL #26530

saschanaz opened this issue Aug 18, 2018 · 1 comment

Comments

@saschanaz
Copy link
Contributor

saschanaz commented Aug 18, 2018

TypeScript Version: 3.0.1

Search Terms: sourceroot, maproot, sourceMappingURL

Code

// tsconfig.json
{
  "compilerOptions": {
    "sourceMap": true,
    "outDir": "js/",
    "mapRoot": "js/",
    "sourceRoot": "sources/"
  }
}

// sources/index.ts
"Hello world!";

Expected behavior: It should generate a valid path.

Actual behavior:

"Hello world!";
//# sourceMappingURL=../sources/js/index.js.map

Related Issues: I think #23989 caused this, as 2.9.2 generates a valid (but absolute) path:

"Hello world!";
//# sourceMappingURL=(absolute path)/js/index.js.map

Workaround?: Modifying tsconfig seems to be generate valid paths, but then VS2017 (15.8.1) fail to map the file.

{
  "compilerOptions": {
    "sourceMap": true,
    "outDir": "js/",
    "sourceRoot": "../sources/"
  }
}
"Hello world!";
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sourceRoot":"../sources/","sources":["index.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAA
@saschanaz
Copy link
Contributor Author

The workaround has no problem, it's the Visual Studio that cannot load source maps using relative paths as the app package does not include them.

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

No branches or pull requests

1 participant