我部署了我们在早上反应的网站,我们的AWS豆茎开发服务器的新版本,并出现了一些非常错误的。 我从部署的版本中得到了一个SyntaxError:意外的令牌'<'。然后我决定部署旧版本,但是这给出了同样的错误。经过大量尝试后,我终止了环境并克隆了我的生产环境以创建新的开发服务器,但问题仍然存在。语法错误:意外的记号“<” - bundle.js服务器D不
基本上克隆环境会失败,但它在生产服务器上工作正常。
我注意到的唯一另外一件奇怪的事情是,当我做wget http://phoodster-web-dev.eu-west-1.elasticbeanstalk.com/bundle.js
时,它会返回index.html
而不是bundle.js
文件,而我们的生产服务器正确执行此操作。
任何想法是什么错?
更新: 之所以bundle.js看起来像index.html的是,因为bundle.js显然没有编译。 在日志的NodeJS我可能已经找到了原因:
ERROR in ./~/react-geosuggest/module/input.js Module not found: Error: Cannot resolve module 'react-addons-shallow-compare' in /var/app/current/node_modules/react-geosuggest/module @ ./~/react-geosuggest/module/input.js 15:33-72
ERROR in ./~/react-geosuggest/module/suggest-list.js Module not found: Error: Cannot resolve module 'react-addons-shallow-compare' in /var/app/current/node_modules/react-geosuggest/module @ ./~/react-geosuggest/module/suggest-list.js 13:33-72
ERROR in ./~/react-geosuggest/module/suggest-item.js Module not found: Error: Cannot resolve module 'react-addons-shallow-compare' in /var/app/current/node_modules/react-geosuggest/module @ ./~/react-geosuggest/module/suggest-item.js 13:33-72
还是很陌生的,为什么只对新的克隆,而不是主服务器出现故障。
.js文件中的脚本标记? – Teemu
你已经把HTML代码放入Javascript文件。参考错误在'<!DOCTYPE html>'行上。 – 2016-09-26 12:18:26
当你打开位于这里的'bundle.js'时,你只能看到html内容,而不是javascript块。检查并解决这个问题。 –