# Js file blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)

**URL:** <https://forum.inductiveautomation.com/t/js-file-blocked-due-to-mime-type-text-html-mismatch-x-content-type-options-nosniff/33106>\
**Category:** 3rd Party Modules\
**Created:** [March 16, 2020, 5:24am UTC](https://forum.inductiveautomation.com/t/js-file-blocked-due-to-mime-type-text-html-mismatch-x-content-type-options-nosniff/33106 "2020-03-16T05:24:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [March 16, 2020, 5:24am UTC](https://forum.inductiveautomation.com/t/js-file-blocked-due-to-mime-type-text-html-mismatch-x-content-type-options-nosniff/33106/1 "2020-03-16T05:24:51Z")

</div>

I am getting following error while rendering (using sendFile) an html file containing line \<script src="../../viewer/krpano.js"\> to a browser from a node-js server. I even tried to define the Content-Type="text/javascript" in the above \<script\> line of the HTML page.

The resource from “[http://localhost:3000/viewer/krpano.js”](http://localhost:3000/viewer/krpano.js%E2%80%9D) was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).  
Loading failed for the with source “[http://localhost:3000/viewer/krpano.js”](http://localhost:3000/viewer/krpano.js%E2%80%9D).

Does anyone have an idea how to enable inclusion of src file in the HTML files rendered from nodejs? Google search didn't help me so far. This is required for my third party module AR-SCADA.

---

<div class="post-metadata">

**Author:** ![jspecht](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jspecht/32/6465_2.png) [@jspecht](https://forum.inductiveautomation.com/u/jspecht)\
**Post date:** [March 18, 2020, 3:54pm UTC](https://forum.inductiveautomation.com/t/js-file-blocked-due-to-mime-type-text-html-mismatch-x-content-type-options-nosniff/33106/2 "2020-03-18T15:54:49Z")

</div>

Make sure the your web server which is serving up your javascript resource includes the correct mime type in the Content-type header (should be `text/javascript`, not `text/html`)

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [March 18, 2020, 4:04pm UTC](https://forum.inductiveautomation.com/t/js-file-blocked-due-to-mime-type-text-html-mismatch-x-content-type-options-nosniff/33106/3 "2020-03-18T16:04:29Z")

</div>

Thanks for your reply. However I figured out the problem. Its not what you wrote (I had already tried it). The problem is NodeJS doesn't render HTML pages like other servers do, we have to specify the path for static files (such as JS, CSS, iamges etc) in the server code, then send the html file to client. Then it works fine! For inline JS code embedded in HTML page its work just fine, that's why I hadn't realized this earlier. Now its running fine. I will soon release a new version of my AR-SCADA module which will run on NodeJS server, connected back to back with Ignition server!

Thanks a lot for your help.

Best
