8
我構建了一個站點。 在開發模式下,它很好地服務於.js文件。 然而,在生產模式下,會出現以下錯誤:Rails返回帶有MIME類型'text/html'的.js
Refused to execute script from 'http://bowuzhi.herokuapp.com/javascripts/items.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
和http://bowuzhi.herokuapp.com/javascripts/items.js內容是HTML:
<div class='page-header'>
<a class="btn btn-primary" href="/zh-TW/items/new"><span class='glyphicon glyphicon-plus'></span>
New
</a><h1>Catalog</h1>
</div>
<div class='row' id='items'>
</div>
<div class='row'>
<div class='col-md-12'>
</div>
</div>
<script src="/javascripts/items.js"></script>
這個網站是在Heroku:http://bowuzhi.herokuapp.com。
爲什麼.js原來是html?
謝謝!完全相同的問題! –