Open moorthi07 opened 6 years ago
Can you link the project URL for this?
hi - i'm having the same issue. Here's a sample (open the chrome debugger console and relaunch stackblitz sample): https://stackblitz.com/edit/react-jserror?file=index.html. There should be 2 console msgs displayed, but it's refusing to run the one from test.js
I have the same problem trying to code a simple Phaser demo. Any idea?
what's your use-case here? Because you could import 'test.js' to your index.js and the code will be executed. Using external scripts is so 2000 😸 ... bundle everything 😃
I don't understand, I make the demo again to show you the error and now it works.
i have the same problem Refused to execute script from 'https://js-tjbyv4.stackblitz.io/index.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.. https://js-tjbyv4.stackblitz.io
@a1nb0 your example project is not running because it's missing index.js
... can you link me to the one you have problems with so I may help to fix it :)
@seveves thanks for your reply, well i had a script.js that was linked in the index.html <script src="script.js"></script>
and still it did not worked. Why do i need a index.js?
Now i renamed script .js to index.js edited index.html too and still the same problem.
What am i doing wrong?
Thank you
LE: added two print screens
look here: https://stackblitz.com/edit/js-1sdwd6?file=index.js
no need to add index.js
with a <script>
tag at all. Works fine for me. How about you?
I have the same problem project URL https://martmax.co/, Any idea?
@mohibrahimm this is really not related to stackblitz. That is an issue with some app service or proxy or whatever.
I have same problem like, Refused to execute script from 'http://localhost:4200/assets/nepalidatepicker.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. please give me a solution.
I solved this error by changing <base href="./">
to <base href="/">
in index.html
Same issue when using a worker. Example: https://stackblitz.com/edit/js-sx3kxa?file=index.js Error Message: "Refused to execute script from 'https://js-sx3kxa.stackblitz.io/worker.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled."
I have the same issue when tried to do ?callback=foo to function in index.js.
I solved this error by changing
<base href="./">
to<base href="/">
in index.html
Thanks, it worked for me too.
Is this solved? I still have MIME type error after adding
Is this solved? I still have MIME type error after adding in index.html
I was working on sample that was working and then just stopped working with this error. Has anybody worked out what is causing it because I am having difficulty working out what I can have changed that caused this - especially since as far as I can work out the error starts after the scripts are executed!
I'm having the same issue , getting "Refused to execute script from 'https://angularq8s8yh-20ke--4200.local-credentialless.webcontainer.io/tooltip.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled."
this is the project link https://stackblitz.com/edit/angular-q8s8yh?file=src/index.html
Steps to reproduce the issue -create a .js file in angular project. -add a script tag like inside index.html file -start the server -see the console where gets the error
GET https://angularq8s8yh-20ke--4200.local-credentialless.webcontainer.io/tooltip.js net::ERR_ABORTED 404 (Not Found) angularq8s8yh-20ke--4200.local-credentialless.webcontainer.io/:1 Refused to execute script from 'https://angularq8s8yh-20ke--4200.local-credentialless.webcontainer.io/tooltip.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
PS. Same issue us coming for typecript and javacript project on stackblitz as well. https://stackblitz.com/edit/js-hbjmrm?file=index.html,tooltip.js,index.js
yes facing the similar issue, but different case :). Im trying to create a service worker with static html template
Same issue; but the problem is really that the .js
file is returning an HTML page, not the actual file contents. In fact, it seems like any requests just return the generatedindex.html
. My guess is that packed files get put onto a separate URL/path. 🤔
My assumption was we could just link to local CSS/JS files without a problem. The use case for us is that we need a custom .js
file available globally that we provide via the embedded SDK. It can't be part of the module (i.e. can't be import
'd), it's a global script that should be on the page. Clarification: Actually, it could be imported but for some reason causes the "infinite loading" issue where the dev server never boots up. So figured I could include it on the page instead.
loader.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
angular 5