I am using the latest VS2015 with the following options set in my project file for typescript:
<PropertyGroup>
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptCompileOnSaveEnabled>true</TypeScriptCompileOnSaveEnabled>
<TypeScriptNoImplicitAny>false</TypeScriptNoImplicitAny>
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
<TypeScriptRemoveComments>false</TypeScriptRemoveComments>
<TypeScriptOutFile></TypeScriptOutFile>
<TypeScriptOutDir></TypeScriptOutDir>
<TypeScriptGeneratesDeclarations>false</TypeScriptGeneratesDeclarations>
<TypeScriptSourceMap>true</TypeScriptSourceMap>
<TypeScriptMapRoot></TypeScriptMapRoot>
<TypeScriptSourceRoot></TypeScriptSourceRoot>
<TypeScriptNoEmitOnError>true</TypeScriptNoEmitOnError>
</PropertyGroup>
My problem is when it compiles a file:
UserService.ts it creates a userservice.js and a userservice.js.map
Which then contains //# sourceMappingURL=userservice.js.map
the userservice.js.map then has this line:
sources":["userservice.ts"]
Has anyone else seen this? I have tried recreating the files and same. This is causing me a lot of problems.
Follow up:
When I create a typescript file UserServicexxxx.ts everything works. When I delete all UserService files and create a UserService.ts then it goes back to doing what it did before.
I've been struggling now for 30 minutes or more trying to create UserService.ts, UserService.js and UserService.js.map :-(
This issue may be the cause: https://github.com/Microsoft/TypeScript/issues/2011
Have you checked that any files you reference UserService.ts from are correctly cased? If they are cased userservice.ts, it will compile to userservice.js, regardless of the actual casing of the ts file. They don't check this right now for performance reasons, but it creates odd bugs like this.
Clean your project and do a search for 'userservice.ts'. If you find one, change the case to the proper CamelCasing and recompile.
I've repro'd this issue here:
Check extra hard for any lingering links!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With