After migrating to RC6, I started getting a bunch of errors when initialising my application.
At first, I was hitting the traceur not found error, which I've solved.
I've added the correct packages to package.json
and pointed system.config.js
to work with the UMD files.
However, now I get a bunch of other errors like the one bellow (more precisely, I get 121 errors.
zone.js:1241 XMLHttpRequest cannot load npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.scheduleTask
(...)
33system.src.js:373 Assertion failed: loading or loaded
What's the deal with this? How can I solve it? I've explicitly set my "server" requests (on the service classes) to explicitly define the Headers but I'm still hitting this issue.
Anyone else faced the same problem?
EDIT
Adding system.config.js and package.json for clarification
System.config.js
(function(global) {
System.config({
paths: {
'npm:': 'node_modules'
},
// map tells the System loader where to look for things
map: {
'app': 'www/build', // 'dist',
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
// angular testing umd bundles
'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
'rxjs': 'npm:rxjs',
'primeng': 'npm:primeng',
'lodash': 'npm:lodash',
'angular2-jwt': 'npm:angular2-jwt/angular2-jwt.js',
'routes': 'app/routes',
'services': 'app/services'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {main: 'app.js', defaultExtension: 'js'},
rxjs: {defaultExtension: 'js'},
primeng: {defaultExtension: 'js'},
lodash: {main: 'index.js', defaultExtension: 'js'},
'angular2-jwt': {defaultExtension: 'js'}
}
})
})(this);
package.json
{
"name": "my-admin",
"version": "0.0.1",
"description": "Admin UI",
"private": true,
"main": "",
"scripts": {
"postinstall": "npm run typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"typings": "typings"
},
"dependencies": {
"@angular/common": "2.0.0-rc.6",
"@angular/compiler": "2.0.0-rc.6",
"@angular/core": "2.0.0-rc.6",
"@angular/forms": "2.0.0-rc.6",
"@angular/http": "2.0.0-rc.6",
"@angular/platform-browser": "2.0.0-rc.6",
"@angular/platform-browser-dynamic": "2.0.0-rc.6",
"@angular/router": "3.0.0-rc.2",
"angular-cli": "^1.0.0-beta.10",
"angular2-jwt": "^0.1.22",
"chart.js": "^2.2.1",
"core-js": "^2.4.1",
"lodash": "^4.15.0",
"ng2-translate": "^2.4.2",
"primeng": "^1.0.0-beta.15",
"primeui": "^4.1.12",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.11",
"systemjs": "^0.19.27",
"timsort": "^0.3.0",
"tslint": "^3.13.0",
"zone.js": "^0.6.21",
"es6-shim": "^0.35.1"
},
"devDependencies": {
"concurrently": "^2.0.0",
"del": "^2.2.0",
"eslint": "^3.1.0",
"eslint-config-google": "^0.6.0",
"fs": "0.0.2",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.1",
"gulp-concat": "^2.6.0",
"gulp-debug": "^2.1.2",
"gulp-insert": "^0.5.0",
"gulp-minify-css": "^1.2.4",
"gulp-sass": "^2.3.2",
"gulp-watch": "4.3.5",
"lite-server": "^2.2.2",
"http-server": "^0.9.0",
"run-sequence": "1.1.5",
"typescript": "^1.8.10",
"typings": "^1.0.4"
},
"repository": {
"type": "git",
"url": "<url>"
},
"author": "Myself",
"license": "ISC",
"homepage": "<url>#readme"
}