'Script from TypeScript was blocked because of a disallowed MIME type (“video/mp2t”)
I'm trying to run a TypeScript file,the only code in the file is console.log("test")
i sourced it to a boiler plate HTML file,but when i try to execute in a live server with the VSC Live Server extention i get the error message:
Script from **file** was blocked because of a disallowed MIME type (“video/mp2t”)
I have searched everywhere and no solution works for me,help would be appreciated.
Solution 1:[1]
Found the solution,turns out i just needed to use the tsc command to compile to JavaScript
Solution 2:[2]
fix this by add some code to karma.conf.js
mime: {
'text/x-typescript': ['ts','tsx']
}
Solution 3:[3]
It also happens when you are linking .ts file with html, instead of .js file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | thenetwork |
| Solution 2 | |
| Solution 3 | Nirali Vaghela |
