Code Monkey home page Code Monkey logo

Comments (7)

cduecker avatar cduecker commented on May 21, 2024 1

Thank you for your example. I agree it is best to map sources. To solve my problem I changed my map statement to include '.js' in the key. I thought that setting defaultExtension: 'js' in the packages object in System.config would make it unnecessary to have '.js' in the alias. Clearly, I don't understand systemjs well enough. The following config is what I'm now using in index.html:
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
},
'angular2-highcharts': {
format: 'cjs',
defaultExtension: 'js'
}
},
map: {
'angular2-highcharts': 'node_modules/angular2-highcharts',
'highcharts/highstock.src.js': 'node_modules/highcharts/highstock.js'
},
});

from angular2-highcharts.

gevgeny avatar gevgeny commented on May 21, 2024

Which bundler do you use ?

from angular2-highcharts.

cduecker avatar cduecker commented on May 21, 2024

systemjs : 0.19.24
node : 5.5.0
npm : 3.8.2

from angular2-highcharts.

gevgeny avatar gevgeny commented on May 21, 2024

I think it is better to map sources. Look at the example of loading via systemjs http://plnkr.co/edit/pnkc8Iw9cSrCYn9zr0VZ?p=preview. I am not a specialist in systemjs so would be great if you suggest how to manage this better.

from angular2-highcharts.

cduecker avatar cduecker commented on May 21, 2024

Ok, I just looked again at 'node_modules/angular2-highcharts/dist/Highcharts.js' and I see that the '.js' extension is included in the reference (var Highcharts = require('highcharts/highstock.src.js');)
So my real problem was that the name of my alias in the map statement was not exactly the same as the name in the reference. I should have caught this. It looks like the current version of dist/Highcharts.js does not include the extension. I am using v. 0.0.5. In any case the problem is solved and I thank you very much for your help.

from angular2-highcharts.

gevgeny avatar gevgeny commented on May 21, 2024

Good.

from angular2-highcharts.

devrockzz avatar devrockzz commented on May 21, 2024

GET http://localhost:4200/node_modules/angular2-highcharts 404 (Not Found)scheduleTask @ zone.js:101ZoneDelegate.scheduleTask @ zone.js:336Zone.scheduleMacroTask @ zone.js:273(anonymous function) @ zone.js:122send @ VM729:3fetchTextFromURL @ system.src.js:1154(anonymous function) @ system.src.js:1735ZoneAwarePromise @ zone.js:584(anonymous function) @ system.src.js:1734(anonymous function) @ system.src.js:2759(anonymous function) @ system.src.js:3333(anonymous function) @ system.src.js:3600(anonymous function) @ system.src.js:3985(anonymous function) @ system.src.js:4448(anonymous function) @ system.src.js:4700(anonymous function) @ system.src.js:406ZoneDelegate.invoke @ zone.js:323Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
zone.js:461 Unhandled Promise rejection: Error: XHR error (404 Not Found) loading http://localhost:4200/node_modules/angular2-highcharts
at XMLHttpRequest.wrapFn as _onreadystatechange
at ZoneDelegate.invokeTask (http://localhost:4200/vendor/zone.js/dist/zone.js:356:38)
at Zone.runTask (http://localhost:4200/vendor/zone.js/dist/zone.js:256:48)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:4200/vendor/zone.js/dist/zone.js:423:34)
Error loading http://localhost:4200/node_modules/angular2-highcharts as "angular2-highcharts" from http://localhost:4200/app/app.component.js ; Zone: ; Task: Promise.then ; Value: Error: Error: XHR error (404 Not Found) loading http://localhost:4200/node_modules/angular2-highcharts(…)consoleError @ zone.js:461_loop_1 @ zone.js:490drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426
zone.js:463 Error: Uncaught (in promise): Error: Error: XHR error (404 Not Found) loading http://localhost:4200/node_modules/angular2-highcharts(…)
i am using angular cli

from angular2-highcharts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.