我有一个在前端使用早午餐、卓别林和咖啡脚本的应用程序。Brunch 构建应用程序时没有任何错误。但是,当我这样做brunch watch --server
并导航到时http://localhost:3333
,会生成错误并且页面永远不会加载。
这以前工作得很好。diff
显示存储库中没有会导致行为变化的变化。当我了解开发人员时,我还检查了前端代码的早期版本。服务器正在工作,但它们都给出了相同的错误。我尝试删除构建的代码并完全重建,但这也无济于事。
我想这一定是我在一个未跟踪的文件中所做的事情,但对于我的生活,我找不到它。这是 chrome 错误消息的输出:
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3333/pub/css/app.css". localhost/:10
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3333/pub/js/vendor.js". localhost/:11
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3333/pub/js/app.js". localhost/:20
Uncaught SyntaxError: Unexpected token < vendor.js:1
Uncaught SyntaxError: Unexpected token < app.js:1
Uncaught ReferenceError: require is not defined (index):21
(anonymous function) (index):21
中的违规行index
似乎是
<script>require('initialize');</script>
这条线与其他类似配置的完美运行的项目没有变化。我认为这可能是愚蠢的,但它只是模糊到网络搜索没有太大帮助。希望其他人遇到过这个问题。
我能做些什么来诊断问题或解决这个问题?