Angular 2 RC 4 “(SystemJS) Can't resolve all parameters for [object Location]: ” in IE 11

不打扰是莪最后的温柔 提交于 2019-12-05 08:14:36

It has something to do with LocationStrategy (HashLocationStrategy etc.), location strategies are stored in @angular/common package.

Check your bootstrap code, clear IE cache, try reinstalling packages.

Found the problem, it was not in any of the files I showed here, but one component had: providers: [Location], and this was not used anywhere or imported from anything..

Change

<!-- polyfills for older browsers -->
<script src="vendor/es5-shim/es5-shim.min.js"></script>
<script src="vendor/es6-shim/es6-shim.min.js"></script>
<script src="vendor/systemjs/dist/system-polyfills.js"></script>
<script src="https://npmcdn.com/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
<script src="vendor/core-js/client/shim.min.js"></script>

<!-- default -->
<script src="vendor/zone.js/dist/zone.min.js"></script>
<script src="vendor/reflect-metadata/Reflect.js"></script>
<script src="vendor/systemjs/dist/system.src.js"></script>

to

<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!