When debugging a .NET 4.6.1 web application using Cassini (Visual Studio 2015 version 14, update 3), I'm getting this error on a page that uses TypeScript:
Refused to execute script from 'http://localhost:53049/Scripts/app.ts' because its MIME type ('video/vnd.dlna.mpeg-tts') is not executable.
The errors happens in Chrome Version 55.0.2883.87 m (64-bit), and not IE. The error seems to have cropped up after the last Chrome update.
I understand that Visual Studio maps .js files to .ts files and can debug .ts files when running on Cassini.
So, it seems that I need to
1) get Chrome to execute .ts files
or
2) get Visual Studio to stop trying to get Chrome to execute .ts files and just use the transpiled .js files.
How can I do either?
Here are my TypeScript Build settings. Toggling "Generate source maps" doesn't seem to make a difference.
Make sure that Cassini is serving .ts files with the correct mime type. You can add the following to your web.config file to force it:
<system.webServer>
<staticContent>
<remove fileExtension=".ts" />
<mimeMap fileExtension=".ts" mimeType="application/x-typescript" />
</staticContent>
</system.webServer>