问题
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