Ni.c0de.mus
Ni.c0de.mus

Reputation: 61

MIME Type Error for Javascript file - VS Code/Live server - Firefox/Console

I try to open html/js file using VS Code/liveServer/firefox/console, and I get the following errors

I have searched google for answers and had a look on the firefox 'learn more' linked to the errors but I don't know enough to use the information, if there is a file to modify or an error in my basic html file (which I think is ok because it worked yesterday) then for me just a point in the right direction would be good! ;o)

The resource from “http://localhost:5500/js/script.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff). Source map error: TypeError: NetworkError when attempting to fetch resource. Resource URL: moz-extension://e3e6edd3-45b6-47f8-895b-6e7fa20f8f13/browser-polyfill.js Source Map URL: browser-polyfill.js.map[Learn More] The resource from “http://localhost:5500/js/script.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).[Learn More] localhost:5500 Loading failed for the with source “http://localhost:5500/js/script.js”.

CODE HTML

`

console.log('test')
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>c0de-geek-js-1</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" media="screen, projection" href="../css/styles.css">
    <script type="text/javascript" src="../js/script.js"></script>
</head>
<body>
    
</body>
</html>

My code is a basic html bootstrap with 'script' text/javascript ../js/script.js '/script' (brackets omitted) there is no complicated code just basic it worked yesterday but today I get the error above and it's confusing for that alone as it worked, any ideas would be good I am pretty good with google but this I am not sure where to start, many thanks in advance!

I created a GitHub repo if that makes any difference I loaded it through VS Code but all that I have done before and as I said it worked yesterday???

Upvotes: 6

Views: 4080

Answers (1)

Quickstroke
Quickstroke

Reputation: 1

I hope this finds whomever searches for a solution. Change the name of the css and js files to style and script respectively. It should look as follows, Html.index css.style js.script

Upvotes: -1

Related Questions