Chrome showing blank TypeScript file Chrome showing blank TypeScript file google-chrome google-chrome

Chrome showing blank TypeScript file


Place this in your web.config to serve up the TS files:

<configuration>    ...    <system.webServer>        <staticContent>            <mimeMap fileExtension=".ts" mimeType="application/x-typescript" />        </staticContent>    </system.webServer></configuration>


Cordle's answer worked for me, but I also needed to remove the existing MIME map for .ts.

    ...    <system.webServer>        <staticContent>            <remove fileExtension=".ts" />            <mimeMap fileExtension=".ts" mimeType="application/x-typescript" />        </staticContent>    </system.webServer></configuration>

The default MIME map for .ts files was "video/vnd.dlna.mpeg-tts".


I figured out what was going on. I needed to add a mime map for the extension .ts either in IIS or in my web.config. So the browser was asking for the TypeScript file but not getting anything back, therefore it showed up blank.