Closed ben-girardet closed 6 years ago
Probably, both. I doubt that is the correct configuration for that library. I don't know without looking at it. I can investigate this further but probably not until next week. In the mean time, see if anyone has used this with require.js or system.js and how they set that up. If you post that info here, I can try to help quicker probably.
Thanks @EisenbergEffect
I suspect that this library has issues of its with modules dependencies (as mentioned here for example: https://github.com/UDST/vizicities/issues/84).
The issue I mention above comes from the dependencies to THREE.JS. I've been able to fix this issue by adding the following to aurelia.json
"three", // this includes the three library installed as dependency to vizicity
{
"name": "THREE", // adding this help the module loader to load this package when doing an import with the name THREE in capital. Seems to provide sort of an alias name
"path": "../node_modules/three",
"main": "three"
},
However now I get a similar issue for another dependency called TweenLite (which is part of another npm package (gsap). I've manually installed gsap:
npm install gsap --save
And tried to do the same trick to provide an alias but this time :
"gsap", // loading the package
{
"name": "TweenLite", // try the trick to create an alias for the TweenLite import call
"path": "../node_modules/gsap",
"main": "src/uncompressed/TweenLite"
},
But now I get another issue (the alias trick doesn't seem to work)
{ uid: 3,
name: 'readProjectConfiguration',
branch: false,
error:
{ Error: ENOENT: no such file or directory, open 'node_modules/TweenLite/package.json'
at Error (native)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'node_modules/TweenLite/package.json' },
duration: [ 0, 58962783 ],
time: 1466680620724 }
Hope this helps to debug this issue. Meanwhile I wonder if there is a proper way to create "aliases" for importing library. Something similar to the map
property in the config.js
file that was created by jspm
Did you install TweenLite? It says it can't find the package. What is the actual package name?
TweenLite
is part of the gsap
package.
Ok, that's the problem. You need a flat package structure for both our CLI and Webpack. So, you need to be either using NPM 3 or use a dedupe tool to flatten your node modules tree. We added a note to this in the readme the other day but you may have missed it or not quite understood the implications. I recommend you update to npm 3.
You're right I don't quite understand the implications. I understand that the gsap package seems to be designed in a non-conventional way. I am using npm 3.9.5 so this doesn't seem to be the solution.
I will look into what "dedupe" means and see if I find a solution.
You mean that gsap is included directly in there. I see. I think we probably need to make some improvements to our code to handle the scenario where there's no package.json. I'm converting this to a bug. Can you provide drop a zip on this issue that contains the project, minus the node module folder, so I can just npm install it and test?
Perfect. I'll take a look later today. CLI is still pretty alpha...we think it will be nice once we work out a few of these issues ;) Thank you for your patience.
dang, running into the same issue whilst trying to include aurelia-api just want to know if there is already a solution to this?
Take a look at the updated readme, in the section on 3rd party libraries and see if the new options available there will get these libraries working for you.
no activity since July 2016
I've tried to include the github repository UDST/vizicities in a freshly
aurelia-cli
created project:Then I added the package in
aurelia_project/aurelia.json
:And finally I ran the
au run --watch
command. This produces the following error:Am I doing something wrong or is this a CLI issue ?