admin管理员组文章数量:1418361
I'm piling my .TS to JavaScript and generating source maps. However, I can't debug the actual files. I have an X number of .TS files that piles into CombinedTypescript.js with a source map that is correct.
However, when I try to access my .TS files in the Chrome Debugger, it just gives me a 404 response. The files exist in "Sources", but I can't access them or set breakpoints in CombinedTypescript.js and step through my files.
Does anyone have an idea of what the problem might be?
I'm piling my .TS to JavaScript and generating source maps. However, I can't debug the actual files. I have an X number of .TS files that piles into CombinedTypescript.js with a source map that is correct.
However, when I try to access my .TS files in the Chrome Debugger, it just gives me a 404 response. The files exist in "Sources", but I can't access them or set breakpoints in CombinedTypescript.js and step through my files.
Does anyone have an idea of what the problem might be?
Share Improve this question asked Feb 4, 2015 at 12:24 Emil LarssonEmil Larsson 2264 silver badges15 bronze badges 4- 2 Are you using IIS? You probably have to add .ts as an mime type (or this) – David Sherret Commented Feb 4, 2015 at 14:59
- 1 @DavidSherret I would post that as the answer – basarat Commented Feb 4, 2015 at 23:00
- @basarat I didn't want to answer with the assumption they were using IIS, but yeah that's most likely the issue. – David Sherret Commented Feb 4, 2015 at 23:58
- Thank you! Yep, it was the missing Mime type, what a simple fix. – Emil Larsson Commented Feb 6, 2015 at 8:31
1 Answer
Reset to default 8The issue you are having is most likely that IIS isn't configured to serve .ts
files. You'll need to add .ts
as an MIME type.
Option 1 - Edit web.config
I'd suggest doing this change so that your project will serve .ts
files regardless of the environment. To do this, add an mimeMap
tag to your web.config
under configuration > system.webServer > staticContent
like so:
<configuration>
...
<system.webServer>
<staticContent>
<mimeMap fileExtension=".ts" mimeType="application/x-typescript" />
</staticContent>
</system.webServer>
</configuration>
Source
Option 2 - Configure IIS
Another option is to configure IIS to serve .ts
files. Here are some resources for doing that:
- How to add an MIME type to a web site (IIS 8)
- Add MIME Type (IIS 7)
- Configure MIME Types (IIS 6)
本文标签: javascriptDebug TypeScript in Chrome404 responseStack Overflow
版权声明:本文标题:javascript - Debug TypeScript in Chrome, 404 response - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745288109a2651622.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论