最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Firefox blocked resource due to Type mismatch - Stack Overflow

programmeradmin2浏览0评论

The resource from http://some-address/script.jsx was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).
This issue I get in console of Firefox (Chrome seems doesn't care about it). Here's a screenshot of console:

I searched for a while trying to find how tot fix it, but failed. Here's the HTML part of the code.

As far as I've understood the problem is due to type="text/babel". But if I would change it to type="text/javascript" then Babel doesn't transpile the script to ES5.

The resource from http://some-address/script.jsx was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).
This issue I get in console of Firefox (Chrome seems doesn't care about it). Here's a screenshot of console:

I searched for a while trying to find how tot fix it, but failed. Here's the HTML part of the code.

As far as I've understood the problem is due to type="text/babel". But if I would change it to type="text/javascript" then Babel doesn't transpile the script to ES5.

Share Improve this question edited Oct 7, 2017 at 20:13 Taras Yaremkiv asked Dec 10, 2016 at 13:47 Taras YaremkivTaras Yaremkiv 3,6008 gold badges33 silver badges56 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

this is because your server send response header X-Content-Type-Options: "nosniff", remove it or change mime type for jsx to text/babel with .htaccess it can done by adding AddType text/babel jsx

发布评论

评论列表(0)

  1. 暂无评论