When I try to import this module via SystemJS I get the following error.
"(SystemJS) XHR error (404 Not Found) loading http://localhost/pim/traceur.js
Error: XHR error (404 Not Found) loading http://localhost/pim/traceur.js
at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost/pim/node_modules/zone.js/dist/zone.js:1190:29) [<root>]
at Zone.runTask (http://localhost/pim/node_modules/zone.js/dist/zone.js:166:47) [<root> => <root>]
at XMLHttpRequest.ZoneTask.invoke (http://localhost/pim/node_modules/zone.js/dist/zone.js:416:38) [<root>]
Error loading http://localhost/pim/traceur.js
Unable to load transpiler to transpile http://localhost/pim/node_modules/angular2-tree-component/dist/angular2-tree-component.js
Error loading http://localhost/pim/node_modules/angular2-tree-component/dist/angular2-tree-component.js as "angular2-tree-component" from http://localhost/pim/app/app.module.js"
My current systemjs.config.js file:
(function (global) {
System.config({
defaultJSExtensions: true,
paths: {
// paths serve as alias
'npm:': 'node_modules/',
'dragula': 'node_modules/dragula/dist/dragula.js'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
'@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/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/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
"ng2-bootstrap": 'npm:ng2-bootstrap/bundles/ng2-bootstrap.umd.js',
"ng2-charts": 'npm:ng2-charts/bundles/ng2-charts.umd.js',
"moment": 'npm:moment/moment.js',
'angular2-tree-component': 'npm:angular2-tree-component',
'lodash': 'npm:lodash',
'ng2-file-upload': 'npm:ng2-file-upload/bundles/ng2-file-upload.umd.js',
'ng2-validation': 'npm:ng2-validation/bundles/ng2-validation.umd.js',
'ng2-dragula': 'npm:ng2-dragula',
'ng2-select': 'npm:ng2-select/index.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
main: './main.js',
defaultExtension: 'js'
},
rxjs: {
main: './Rx.js',
defaultExtension: 'js'
},
'angular2-tree-component': {
main: 'dist/angular2-tree-component.js',
defaultExtension: 'js'
},
'lodash': {
main: 'lodash.js',
defaultExtension: 'js'
}
}
});
})(this);
I also got the same error
I fixed it here https://github.com/500tech/angular2-tree-component/issues/160#issuecomment-280161341, make sure you're on 2.8.1. Use the following map for SystemJS, no entry in packages required.
map: {
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
…
'angular2-tree-component': 'node_modules/angular2-tree-component/dist/angular2-tree-component.umd.js',
…
}
It is working. Thank you very much
Thanks, I'll add it to the documentation.
Updated