Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSPM Install Does not create js file to import #21

Open
pierslawson opened this issue Nov 1, 2016 · 43 comments
Open

JSPM Install Does not create js file to import #21

pierslawson opened this issue Nov 1, 2016 · 43 comments

Comments

@pierslawson
Copy link

I have installed Aurelia-chart using your JSPM instructions and it has turned up in my package.json and config.js files OK. The files are also present in a [email protected] directory under my jspm_packages/npm directory. However, for other packages I see a corresponding js file in the jspm_packages/npm directory, but there isn't a [email protected] file created. So when my application runs I get a 404 as the browser tries to load jspm_packages/npm/[email protected]

I wondering if I have missed a step?

@pierslawson
Copy link
Author

A work around from stackoverflow is to use .feature("aurelia-chart"); rather than .plugin("aurelia-chart");

http://stackoverflow.com/questions/38695467/pluginaurelia-chart-throws-404-error

@grofit
Copy link
Owner

grofit commented Nov 1, 2016

This has been mentioned a few times there is a distinction between feature and plugin, when using feature you are telling something to load locally, if you are using plugin you are telling it to load from a module/external.

There should be an aurelia-chart.js file within the dist/commonjs directory which I believe is where the package.json looks. I am not sure if JSPM has done some new update which stops this stuff working but as of JSPM 16.* it was working fine (I think it was JSPM 16... its been a while since I did anything with JSPM since they went to the CLI... and no doubt one day to some other tooling :( )

@pierslawson
Copy link
Author

No, aurelia-chart.js hasn't turned up in the dist directory. The loader tries to load jspm_packages/npm/[email protected] but that doesn't exist either. I've got JSPM 0.16.47 running.

@grofit
Copy link
Owner

grofit commented Nov 2, 2016

Can you screenprint or tell me what is in your JSPM folder for the aurelia-chart module?

@pierslawson
Copy link
Author

-wwwroot
  |- jspm_packages
           |- npm
                |- [email protected]
                     |- .jspm-hash
                     |- index.js
                     |- attributes
                     |      |- chart-attribute.js
                     | 
                     |- elements
                     |      |- chart-element.html
                     |      |- chart-element.js
                     | 
                     |- observers
                            |- model-observer.js

@grofit
Copy link
Owner

grofit commented Nov 3, 2016

hmm that is very odd as the dist folders which the package.json should be linked to output aurelia-chart.js after someones change to fix something along these lines before:

https://github.com/grofit/aurelia-chart/tree/master/dist/system

So to my knowledge that is what the jspm should be using, does anyone else have this issue? (I have lost weeks of my life to the aurelia tooling stuff so I am often reluctant to spend more time on it unless knowing there is a specific problem which wont somehow break it for others, which is often the case).

@urosg80
Copy link

urosg80 commented Nov 3, 2016

@grofit did you actually update the npm package after importing my pull request into github? It appears as no, can you check as the version on github is 0.2.6 (as per my pull request) but here is 0.2.5 listed.

@grofit
Copy link
Owner

grofit commented Nov 3, 2016

I cannot remember, I will clone it all and give it a whirl now as there is another PR which needs to be built and released.

@urosg80
Copy link

urosg80 commented Nov 3, 2016

I think this issue could be linked as duplicate #15

grofit added a commit that referenced this issue Nov 3, 2016
… making sure the binding changes in #22 are released.
@grofit
Copy link
Owner

grofit commented Nov 3, 2016

Right I have done a new release, ran it all locally and it works, I did notice that for some reason it was back to being index but referencing the aurelia-chart.js, I dont remember who made that change as I think I always had it as index, anyway it should all work in 0.2.6 which is also released on NPM so please give that a try and let me know if it fixes this issue.

@pierslawson
Copy link
Author

I'm afraid that didn't fix it. I still get a 404 as the browser tries to load jspm_packages/npm/[email protected]

I did get a warning as JSPM was updating the package:

jspm update npm:aurelia-chart
     Looking up npm:aurelia-chart
     Updating registry cache...
     Downloading npm:[email protected]
     Looking up npm:aurelia-framework
     Looking up npm:chart.js
     Looking up npm:aurelia-binding
     Looking up npm:aurelia-dependency-injection
     Looking up npm:aurelia-loader
     Looking up npm:aurelia-logging
     Looking up npm:aurelia-metadata
     Looking up npm:aurelia-pal
     Looking up npm:aurelia-path
     Looking up npm:aurelia-task-queue
     Looking up npm:aurelia-templating
     Looking up npm:chartjs-color
     Looking up npm:moment
     Looking up npm:color-convert
     Looking up npm:chartjs-color-string
     Looking up npm:color-name

warn Main entry point not found for npm:[email protected].
     Adjust this property in the package.json or with an override, setting "main": false if this is the intention.

     Looking up github:jspm/nodelibs-process
     Looking up github:jspm/nodelibs-child_process
     Looking up github:systemjs/plugin-json
     Looking up github:jspm/nodelibs-buffer
     Looking up npm:process
     Looking up github:jspm/nodelibs-vm
     Looking up github:jspm/nodelibs-assert
     Looking up github:jspm/nodelibs-fs
     Looking up npm:buffer
     Looking up npm:base64-js
     Looking up npm:ieee754
     Looking up npm:isarray
     Looking up npm:assert
     Looking up npm:util
     Looking up npm:vm-browserify
     Looking up npm:indexof
     Looking up npm:inherits
     Looking up github:jspm/nodelibs-util
ok   Installed aurelia-chart as npm:aurelia-chart@^0.2.5 (0.2.6)
     Clearing configuration for npm:[email protected]
     Removing package files for npm:[email protected]
ok   Install tree has no forks.

ok   Install complete.

@urosg80
Copy link

urosg80 commented Nov 4, 2016

@pierslawson can you try to install from my repo just for test: "jspm install github:urosg80/aurelia-chart" as this was working before.

@grofit
Copy link
Owner

grofit commented Nov 4, 2016

AH ok, so can anyone confirm does JSPM need its OWN main section in the package.json as there is a default npm main entry point and I thought JSPM used the same one.

https://github.com/grofit/aurelia-chart/blob/master/package.json#L13

There is the one for the latest version so as you can see there is a main in there that references the correct file.

@urosg80
Copy link

urosg80 commented Nov 4, 2016

I am guessing that the problem is in the "index.js" file names as when I was testing for my fix only after renaming the index.js files to aurelia-chart.js and fixing the references then JSPM installation worked.

@grofit
Copy link
Owner

grofit commented Nov 4, 2016

ah so it was you who renamed them, I couldnt care less what the names were, but when I pulled latest and gulped it renamed them all back to index and it seemed ok.

@pierslawson
Copy link
Author

@urosg80 I tried your branch as suggested and get the same issue when trying the use.plugin call as opposed to the feature call:

HTTP404: NOT FOUND - The server has not found anything matching the requested URI (Uniform Resource Identifier).
(XHR)GET - http://localhost:49862/jspm_packages/github/urosg80/[email protected]

@pierslawson
Copy link
Author

Sorry, didn't mean to close this

@pierslawson pierslawson reopened this Nov 8, 2016
@Keethanjan
Copy link

@pierslawson I had the same issues but if I add the following lines to config.js it seems to work fine.:
packages: { "aurelia-chart": { "main": "index.js" } },.

@grofit
Copy link
Owner

grofit commented Nov 10, 2016

We do that on the example to fudge JSPM to load the module locally, but you should not need to do that normally, ultimately its a JSPM related issue, if someone can show me or do a PR with the desired JSPM config that will load it all correctly I will get it added.

@urosg80
Copy link

urosg80 commented Nov 10, 2016

can someone please try install from my npm package: "jspm install npm:aurelia-ugchart" (https://www.npmjs.com/package/aurelia-ugchart) it's the 0.2.5 version prepared for my previous PR as it seems to me that JSPM is quite picky for installation depending on source (npm, git, ...)

@grofit
Copy link
Owner

grofit commented Nov 10, 2016

didnt @pierslawson try your branch and got the same issue?

@urosg80
Copy link

urosg80 commented Nov 10, 2016

yes, but from github and this is why I suspect that JSPM is handling installation differently depending on source and would just like to double check as it worked for me when installing from npm and why I then submitted the PR

@pierslawson
Copy link
Author

@urosg80 I've installed your package and didn't get any install warnings... however the package has not actually been installed in the JSPM directory... I'll try again. This was the information spat out by JSPM as I installed

 jspm install npm:aurelia-ugchart
     Looking up npm:aurelia-ugchart
     Updating registry cache...
     Downloading npm:[email protected]
     Looking up npm:aurelia-framework
     Looking up npm:chart.js
     Looking up npm:chartjs-color
     Looking up npm:moment
     Looking up npm:aurelia-binding
     Looking up npm:aurelia-dependency-injection
     Looking up npm:aurelia-loader
     Looking up npm:aurelia-logging
     Looking up npm:aurelia-metadata
     Looking up npm:aurelia-pal
     Looking up npm:aurelia-path
     Looking up npm:aurelia-task-queue
     Looking up npm:aurelia-templating
     Looking up npm:color-convert
     Looking up npm:chartjs-color-string
     Looking up npm:color-name
     Looking up github:jspm/nodelibs-child_process
     Looking up github:jspm/nodelibs-buffer
     Looking up github:systemjs/plugin-json
     Looking up github:jspm/nodelibs-process
     Looking up npm:buffer
     Looking up npm:base64-js
     Looking up npm:ieee754
     Looking up npm:isarray
     Looking up github:jspm/nodelibs-fs
     Looking up npm:process
     Looking up github:jspm/nodelibs-vm
     Looking up github:jspm/nodelibs-assert
     Looking up npm:vm-browserify
     Looking up npm:assert
     Looking up npm:indexof
     Looking up npm:util
     Looking up npm:inherits
     Looking up github:jspm/nodelibs-util
ok   Installed aurelia-ugchart as npm:aurelia-ugchart@^0.2.10 (0.2.10)
ok   Install tree has no forks.

ok   Install complete.

@grofit
Copy link
Owner

grofit commented Nov 16, 2016

lol the plot thickens

@pierslawson
Copy link
Author

pierslawson commented Nov 16, 2016

OK... I tried to uninstall and was given the message:

warn Dependency npm:aurelia-ugchart is not an existing primary install.

So I manually deleted it from package.json and config.js. I installed again and the sub-directory was created and the [email protected] was put into the correct directory. I changed from use.feature() to .use.plugin() and it worked!

@urosg80
Copy link

urosg80 commented Nov 23, 2016

@grofit as you can see the PR I prepared before works and as I suspected JPSM handles installation from different sources differently i.e. source from npm installs but from github not although the actual files are the same... "interesting" ;)

@grofit
Copy link
Owner

grofit commented Nov 23, 2016

just to confirm when you use the official npm repo for this npm:aurelia-chart do you get the same issue? cannot remember if you were installing via github or npm by default?

If it is down to the way JSPM handles this I think its something to be discussed with JSPM guys but I dont really have capacity to chase those guys down again, so if anyone else is in that domain and fancies picking it up with them go for it.

@ghost
Copy link

ghost commented Nov 29, 2016

Around a month ago I was able to resolve this issue by installing from master instead of the regular release. However, since you have made the change to "fix" this problem for release, I have no longer been able to use this work-around. The latest release does not resolve the issue either.

@JesseNewman19
Copy link

JesseNewman19 commented Nov 29, 2016

I am still having this issue as well.

I've tried installing the package in the following ways:
jspm install aurelia-chart
jspm install npm:aurelia-chart
jspm install github:grofit/aurelia-chart
jspm install github:grofit/aurelia-chart@master
jspm install github:urosg80/aurelia-chart

Regardless of my installation method, there is never an "aurelia-chart.js" inside of the package directory, as there should be, and I receive the aforementioned "404 not found" error upon loading my aurelia app.

EDIT: As noted below, "jspm install npm:aurelia-ugchart" works fine.

@urosg80
Copy link

urosg80 commented Nov 29, 2016

@JesseNewman19 please try also and report:
jspm install npm:aurelia-ugchart

@JesseNewman19
Copy link

JesseNewman19 commented Nov 29, 2016

@urosg80 That one worked for me, thanks.

@grofit
Copy link
Owner

grofit commented Nov 30, 2016

by all means @urosg80 do another PR with the current version to make it work (making sure the demos still work too).

@matdar
Copy link

matdar commented Nov 30, 2016

I couldn't get this to work in my app (the same 404 as above) so I setup a fresh app via the skeleton-esnext (1.1.1), ran:

jspm install npm:aurelia-ugchart

added:
use .plugin("aurelia-ugchart");

and the added aura-ugchart to bundles.js

"dist/aurelia": {
      "includes": [
        "aurelia-framework",
        ...
        "aurelia-ugchart",
        "[aurelia-ugchart/**/*.js]",
        "[aurelia-ugchart/**/*.html]"

and that all seems ok when run locally with gulp watch.

If I use gulp export and then run it on my remote server I get 404:

GET http://www.[].com/jspm_packages/npm/[email protected] 404 (Not Found)
Unhandled rejection (SystemJS) XHR error (404 Not Found) loading http://www.[].com/jspm_packages/npm/[email protected]

I confess I'm new to JSPM and gulp - so feel free to point out any blindingly obvious omissions I've made....

Thanks

@JoshMcCullough
Copy link

Do we have a status on this working w/JSPM?

@grofit
Copy link
Owner

grofit commented Jan 9, 2017

current status is:

If someone with more knowledge of JSPM than I can fix this and do a PR it will be solved, I am not actively looking into it as its been fixed multiple times then breaks again for some reason, so I am not sinking any more time into it.

@mohammedJ
Copy link

mohammedJ commented Feb 15, 2017

aurelia-chart version: 0.2.7

The following worked for me:

  • inside config.js, add to System.config:
    packages: { "aurelia-chart": { "main": "index.js" } },

  • inside bundles.js, add to dist/aurelia: includes:
    "aurelia-chart", "[aurelia-chart/**/*.js]", "aurelia-chart/**/*.html!text",

@grofit
Copy link
Owner

grofit commented Feb 15, 2017

config.js and bundles.js are auto generated though right? so is there a way to get it to generate those files with those criteria if that works for everyone?

@JoshMcCullough
Copy link

Although this should be fixed, @grofit, config.js can be edited manually and respects your mappings and bundles.js AFAIK is completely custom.

@mohammedJ
Copy link

mohammedJ commented Feb 15, 2017

@JoshMcCullough Yes, bundles.js is the file used to configure the output, e.g when doing a gulp export. I think only the config.js part needs to be fixed. For other plugins, just referencing the plugin name in bundles.js knows about its own main js file. Maybe renaming index.js to aurelia-chart.js might fix the issue

@grofit
Copy link
Owner

grofit commented Feb 16, 2017

Sorry if I am a bit simple here but where is this bundles.js file? as I only see the config one or the automatically output bundle.js one which I think is for the example only. Is this in a new version of jspm or something?

@mohammedJ
Copy link

@grofit from aurelia-skeleton :
https://github.com/aurelia/skeleton-navigation/blob/master/skeleton-typescript/build/bundles.js

I don't know if this is something you can add. It should rather be part of your ReadMe/Documention

@grofit
Copy link
Owner

grofit commented Feb 16, 2017

That bundles.js is used by the Aurelia bundle builder, which this project doesn't use as it was created before that existed. I am not even sure if that is a supported way of doing things now that they have the new aurelia cli for stuff

@kuwv
Copy link

kuwv commented Oct 27, 2017

I believe this is the solution: https://jspm.io/0.17-beta-guide/overrides.html
jspm/registry#516

jspm install npm:aurelia-chart -o "{main: 'index.js'}"

Repository owner deleted a comment from sandipbhuyan Jan 23, 2024
Repository owner deleted a comment from sandipbhuyan Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants