How to get a bit more help perhaps…?

六眼飞鱼酱① 提交于 2019-12-10 12:24:47

问题


I am a little embarrassed to admit I have just spent more time fixing the dread issue:

**Syntax Error: Unexpected token <**

My mistake was that I had forgotten to add the following to my index.html:

<script src="node_modules/angular2/bundles/router.dev.js"></script>

However I am including:

<script src="node_modules/angular2/bundles/angular2.dev.js"></script>

Is there a way of configuring the angular2 dev version to emit more helpful info which would mean that I would get more helpful info regarding issues like this in dev?


回答1:


The **Syntax Error: Unexpected token <** comes from SystemJS trying to import the ROUTER_PROVIDERS or anything router related. Because you did not add the router.dev.js it won't be able to import it, and the webserver request will return a 404. You will be able to see this error in your network console. The unexpected token < is actually the start tag of <!DOCTYPE html> from your 404 page



来源:https://stackoverflow.com/questions/35861237/how-to-get-a-bit-more-help-perhaps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!