Encountering a puzzling issue with System JS while experimenting with Angular 2.
Initially, everything runs smoothly, but at random times, System JS struggles to locate modules...
An error message pops up:
GET http://localhost:9000/angular2/platform/browser.js 404 (Not Found) @ system.src.js:4891(anonymous function) @ system.src.js:4891
GET http://localhost:9000/angular2/core.js 404 (Not Found) @ system.src.js:4891
GET http://localhost:9000/angular2/router.js 404 (Not Found) @ system.src.js:4891
GET http://localhost:9000/angular2/http.js 404 (Not Found) @ system.src.js:4891
GET http://localhost:9000/angular2/core.js 404 (Not Found) @ system.src.js:4891
GET http://localhost:9000/angular2/http.js 404 (Not Found) @ system.src.js:4891
GET http://localhost:9000/angular2/src/facade/lang.js 404 (Not Found) @ system.src.js:4891
GET http://localhost:9000/angular2/router.js 404 (Not Found) @ system.src.js:4891
The number of errors varies from time to time...
What's most bizarre is that after some waiting and repeatedly refreshing the page, the app mysteriously starts working again!
I'm using [email protected] and [email protected] (latest versions available).
The script section in index.html containing the SystemJS configuration appears like this:
<script src="./node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="./node_modules/es6-shim/es6-shim.min.js"></script>
<script src="./node_modules/systemjs/dist/system.js"></script>
<script>
//configure system loader
System.config({
defaultJSExtensions: true
});
//bootstrap the Angular2 application
System.import('dist/app').catch(console.log.bind(console));
</script>
<script src="./node_modules/rxjs/bundles/Rx.js"></script>
<script src="./node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="./node_modules/angular2/bundles/http.dev.js"></script>
<script src="./node_modules/angular2/bundles/router.dev.js"></script>
Has anyone else come across this problem?
Appreciate any insights or solutions. Thanks!