Refused to execute script from '*.ts' because its MIME type ('video/vnd.dlna.mpeg-tts') is not executable

MARKAND Bhatt

I am new to typescript. I have an angularjs controller which I am trying to convert to typescript controller.

To start with I declared the controller and module

    /// <reference path='../../Scripts/typings/angularjs/angular.d.ts' />
/// <reference path='../../Scripts/typings/jquery/jquery.d.ts' />
'use strict'

interface IRouteParams extends ng.route.IRouteParamsService {
    propertyAddress: string;
}

class Controller1 {
    public propertyAdd: string;
    constructor($scope: any,
        $routeParams: IRouteParams,
        ServicesFactory,
        growl,
        blockUI,
        IMAGE_RELATED_MESSAGES,
        BUSY_MESSAGES,
        $timeout: ng.ITimeoutService,
        $modal,
        Lightbox,
        $filter) {

        this.propertyAdd = $routeParams.propertyAddress;

    }
}

angular.module('Controller').controller('Controller1', Controller1);

when I run this code in browser I get following error

Refused to execute script from 'http://localhost/....../Controller1.ts' because its MIME type ('video/vnd.dlna.mpeg-tts') is not executable.

whats is the pain point?

shadeglare

You have to transpile your typescript code to a regular javascript code. TypeScript is not supposed to run directly in the browser.

Use tsc compiler to produce javascript like this:

tsc helloworld.ts

More details on the official site.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Refused to execute script, strict MIME type checking is enabled?

Importing jQuery plugin into Angular 2+ Refused to execute script because its MIME type ('text/html') is not executable

Refused to execute script from '*' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled

Error on minification in console "Refused to execute because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled"

Webpack dev server throws error - Refused to execute script because its MIME type ('text/html') is not executable

Node/Express - Refused to apply style because its MIME type ('text/html')

Refused to apply style from... because its MIME type ('text/html') is not a supported style-sheet MIME type, and strict MIME checking is enabled

Refused to apply style from '' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled

Refused to execute script from because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled

Refused to apply style because its MIME type "text/html" is not supported stylesheet MIME type, and strict MIME checking is enabled

Node refused to apply style because its MIME type ('text/html') is not a supported stylesheet MIME

Refused to execute script from 'file_name.php' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled

Refused to execute script because strict MIME type checking is enabled

Refused to apply style from 'http://localhost:1234/node_modules/primeicons/primeicons.css' because its MIME type ('text/html')

Tensorboard is showing a blank page (Refused to execute script from 'http://localhost:6006/index.js' because its MIME type)

Refused to execute *path_to_bundle* as script because "X-Content-Type: nosniff" was given and its Content-Type is not a script MIME type

Refused to execute script from '..../angular.min.js' because its MIME type ('application/octet_stream') is not executable, and strict MIME type check

Refused to apply style from 'http://localhost:3000/style.css' because its MIME type ('text/html')

Chrome and Spring security: Refused to execute script from 'http://<server url>/assets/app.js' because its MIME type ('') is not executable

Rewrite requests from loopback to angular2 (Refused to execute script because its MIME type ('text/html') is not executable)

Refused to execute script from URL because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled

Refused to apply style from [Link] because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled

Refused to execute script from 'url' because its MIME type ('image/jpeg') is not executable

Webpack + React.lazy + nested routing: Refused to apply style from '*/css/main.css' because its MIME type ('text/html')

Refused to apply style from 'URL' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled

Refused to apply style because its MIME type ('text/html') is not a supported stylesheet MIME type

"Refused to apply style from because its MIME type "('font/woff2')" is not a supported stylesheet MIME type, and strict MIME checking is enabled"

Refused to display style because MIME type

(Node Express)Refused to apply style because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled