grofit / aurelia-chart

A chart element for aurelia which is powered by chart js using html5 canvas.
MIT License
46 stars 25 forks source link

aurelia-chart.js Error: XHR error (404 Not Found) #15

Closed Narven closed 7 years ago

Narven commented 8 years ago

After installing with jspm and adding the plugin to be loaded with .plugin("aurelia-chart") ... i get

system.js:4 Uncaught (in promise) Error: Error: XHR error (404 Not Found) loading http://localhost:9001/src/aurelia-chart.js

Any ideas? thanks

grofit commented 8 years ago

Someone mentioned elsewhere that the latest version of aurelia has breaking changes with plugins, so at some point next week I will try to update all my plugins again.

Narven commented 8 years ago

Ok, can u let us know... when this is fixed? thanks

spapaseit commented 8 years ago

I'm having the same issue and would be very happy if it gets fixed :)

If there's anything I can do to help, let me know

grofit commented 8 years ago

I have just pushed up 0.2.5 which helps people using NPM but I dont think it will change this, but if you could answer the queries below it may help.

I know from previous experience in most cases where you try to include a plugin and it tries to find my-plugin-name.js it cannot resolve the module, so its going to be JSPM not finding the module, so can you check that:

spapaseit commented 8 years ago

Thanks for you quick reply.

I'v tried installing v0.2.5 (jspm install npm:aurelia-chart), and indeed, the problem persists:

system.js:4 Uncaught (in promise) Error: SyntaxError: Unexpected token <
    Evaluating http://localhost:49851/jspm_packages/npm/aurelia-chart@0.2.5.js
    Error loading http://localhost:49851/jspm_packages/npm/aurelia-chart@0.2.5.js
grofit commented 8 years ago

hmm, I will be honest I am at a loss, I am unable to look at it right now but will create a simple project later with the same versions of everything as you and see what happens, as ultimately it sounds like JSPM is unable to resolve the module but I don't know why.

spapaseit commented 8 years ago

Cheers, let me know if I can assist in any way

ghiscoding commented 7 years ago

I'm not using JSPM even less now that I got Aurelia-Chart working with NPM and WebPack but I'm trying to help since I was the person requesting the npm change of chartjs to be chart.js so that it fits with the actual name on npm org.

All that to say, don't you guys have to update your JSPM mapping to use the new chart.js name? I believe that I had that unexpected token error when the naming/mapping wasn't right.

grofit commented 7 years ago

Did any of the above info from ghiscoding help @spapaseit ?

I think I have sorted the other issues I had on my todo list so if this is still outstanding I can try an take another look for you.

rajsibi7 commented 7 years ago

Also am having the same issue,system.js:4 Uncaught (in promise) Error: Error: XHR error (404 Not Found) loading http://localhost:9001/src/aurelia-chart.js.

rajsibi7 commented 7 years ago

Else how to achieve creating chart in Aurelia ? any other links? It will be helpful for me.

grofit commented 7 years ago

@rajsibi7 are you using webpack or jspm? as the example works with the previous version of aurelia so based off other issues I assume its just a case of someone who knows what the new version of aurelia is looking for needs to update the package and config stuff, the core part of the plugin should be stable and has been for months/years, its just aurelia that keeps breaking.

rajsibi7 commented 7 years ago

@grofit hmm okay and am using jspm and also very new to aurelia framework. Thanks for reply. Detailed here, http://stackoverflow.com/questions/38695467/pluginaurelia-chart-throws-404-error

rajsibi7 commented 7 years ago

@grofit its working if we use 'feature('aurelia-chart')' instead of 'plugin('aurelia-chart')' and idk whats diff between feature and plugin. Thanks.

grofit commented 7 years ago

feature tries to load the files locally from within your project plugin tries to load them as a module from jspm or whatever. I dont know how this is translated into the webpack world etc.

urosg80 commented 7 years ago

Please see pull #20 it works for me.

To elaborate a little bit more, the problem is that when installing through jspm the "alias" .js file is not created, after a little research and experiments I renamed the files "index.js" to "aurelia-chart.js" and modified the package.json so now the JSPM installs this correctly and .plugin works.

grofit commented 7 years ago

Merged this in, if this doesnt solve the problem feel free to re-raise issue.