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

animator-velocity build errors #277

Closed
aidesigner opened this issue Aug 11, 2016 · 9 comments
Closed

animator-velocity build errors #277

aidesigner opened this issue Aug 11, 2016 · 9 comments

Comments

@aidesigner
Copy link

aidesigner commented Aug 11, 2016

I'm submitting a bug report

Library Version: 0.17.0
Operating System: Windows 10
Node Version: 6.2.0
NPM Version: 3.8.9
Browser: Chrome
Language: TypeScript

Current behavior:
As I migrated my project from Aurelia JSPM to the CLI I can no longer get built in library Aurelia Velocity working. I first opened an issue (aurelia/animator-velocity#13) in animator-velocity, but I believe the CLI may be the problem. Also this may be indicative of the issues that arises when adding stubborn libraries. Below is the exact sequence, from scratch, that produces error (Also below). Aurelia with Velocity animations is really awesome, but cannot get the CLI to play nice.

Create Aurelia CLI project and then execute bash commands:
au new - Custom/Typescript/Sass/No Test/VSCode
npm install aurelia-animator-velocity --save
typings install dt~velocity-animate --save --global

Add dependencies into aurelia.json:
"velocity-animate",
{
"name": "aurelia-animator-velocity",
"path": "../node_modules/aurelia-animator-velocity/dist/amd",
"main": "aurelia-animator-velocity"
}

Comment out below in aurelia-animator-velocity.d.ts (Separate Issue):
//import velocity from 'velocity-animate';

Add simple import to app.ts to test aurelia-animator-velocity:
import {VelocityAnimator} from "aurelia-animator-velocity";

Running "au build" produces error below. The current issue is the path to velocity.ui.js should not contains src. Not sure if this a CLI issue or a velocity.ui.js path issue within animator-velocity.

...
Tracing aurelia-animator-velocity...
{ uid: 8,
  name: 'writeBundles',
  branch: false,
  error:
   { Error: ENOENT: no such file or directory, open 'C:\Users\...\Documents\Visual Studio 2015\Projects\Web\AureliaVelocityWebsite\src\node_modules\velocity-animate\velocity.ui.js'
       at Error (native)
       at Object.fs.openSync (fs.js:634:18)
       at Object.fs.readFileSync (fs.js:502:33)
       at Object.exports.readFileSync (C:\Users\...\Documents\Visual Studio 2015\Projects\Web\AureliaVelocityWebsite\node_modules\aurelia-cli\lib\file-system.js:38:13)
       at amodroTrace.fileRead (C:\Users\...\Documents\Visual Studio 2015\Projects\Web\AureliaVelocityWebsite\node_modules\aurelia-cli\lib\build\bundled-source.js:83:31)
       at Object.context.fileRead (C:\Users\...\Documents\Visual Studio 2015\Projects\Web\AureliaVelocityWebsite\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:176:18)
       at Object.context.load (C:\Users\...\Documents\Visual Studio 2015\Projects\Web\AureliaVelocityWebsite\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:357:30)
       at Object.Module.load (eval at <anonymous> (C:\Users\...\Documents\Visual Studio 2015\Projects\Web\AureliaVelocityWebsite\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:14:9), <anonymous>:832:29)
       at Object.Module.fetch (eval at <anonymous> (C:\Users\...\Documents\Visual Studio 2015\Projects\Web\AureliaVelocityWebsite\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:14:9), <anonymous>:822:66)
       at Object.Module.check (eval at <anonymous> (C:\Users\...\Documents\Visual Studio 2015\Projects\Web\AureliaVelocityWebsite\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:14:9), <anonymous>:854:30)
     errno: -4058,
     code: 'ENOENT',
     syscall: 'open',
     path: 'C:\\Users\\...\\Documents\\Visual Studio 2015\\Projects\\Web\\AureliaVelocityWebsite\\node_modules\\velocity-animate\\velocity\\velocity.ui.js',
     moduleTree: [ 'aurelia-animator-velocity' ],
     fileName: 'C:/Users/.../Documents/Visual Studio 2015/Projects/Web/AureliaVelocityWebsite/node_modules/aurelia-animator-velocity/dist/amd/aurelia-animator-velocity.js' },
  duration: [ 2, 545471137 ],
  time: 1470870577009 }
@EisenbergEffect
Copy link
Contributor

Is velocity.ui.js coming from the main field in the velocity package.json file?

@AStoker
Copy link
Contributor

AStoker commented Oct 6, 2016

Excerpt from the package file:

"main": "velocity.js",
"repository": "julianshapiro/velocity",
"files": [
    "velocity.js",
    "velocity.min.js",
    "velocity.ui.js",
    "velocity.ui.min.js"
],

I set up a similar project and am getting the same errors (just to confirm with @aidesigner).
My steps on a base CLI project:
npm install velocity-animate aurelia-animator-velocity --save
Add the following to the aurelia.json file:

 "velocity-animate",
{
     "name": "aurelia-animator-velocity",
     "path": "../node_modules/aurelia-animator-velocity/dist/amd",
     "main": "aurelia-animator-velocity"
},

Add this line to the app.js:
import {VelocityAnimator} from 'aurelia-animator-velocity';
Run au build
The following errors are then thrown:

Tracing app...
{ uid: 8,
  name: 'writeBundles',
  branch: false,
  error: 
   { Error: ENOENT: no such file or directory, open '/Users/astoker/Sites/aurelia-cli/test2/node_modules/velocity-animate/velocity/velocity.ui.js'
       at Error (native)
       at Object.fs.openSync (fs.js:640:18)
       at Object.fs.readFileSync (fs.js:508:33)
       at Object.exports.readFileSync (/Users/astoker/Sites/aurelia-cli/test2/node_modules/aurelia-cli/lib/file-system.js:49:13)
       at fileRead (/Users/astoker/Sites/aurelia-cli/test2/node_modules/aurelia-cli/lib/build/bundled-source.js:83:31)
       at Object.context.fileRead (/Users/astoker/Sites/aurelia-cli/test2/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:176:18)
       at Object.context.load (/Users/astoker/Sites/aurelia-cli/test2/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:357:30)
       at Object.load (eval at <anonymous> (/Users/astoker/Sites/aurelia-cli/test2/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:9), <anonymous>:832:29)
       at Object.fetch (eval at <anonymous> (/Users/astoker/Sites/aurelia-cli/test2/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:9), <anonymous>:822:66)
       at Object.check (eval at <anonymous> (/Users/astoker/Sites/aurelia-cli/test2/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:9), <anonymous>:854:30)
     errno: -2,
     code: 'ENOENT',
     syscall: 'open',
     path: '/Users/astoker/Sites/aurelia-cli/test2/node_modules/velocity-animate/velocity/velocity.ui.js',
     moduleTree: [ 'aurelia-animator-velocity/aurelia-animator-velocity' ],
     fileName: '/Users/astoker/Sites/aurelia-cli/test2/node_modules/aurelia-animator-velocity/dist/amd/aurelia-animator-velocity.js' },
  duration: [ 1, 89071328 ],
  time: 1475764293828 }

Could be some tracing strangeness?

@aidesigner
Copy link
Author

I first posted this question on Aurelia-Velocity before believing in to be a CLI issue. aurelia/animator-velocity#13 presented a good analysis (jdanyow), which lead me to insert the code below in my aurelia.json.

Everything works, but the browser debug console always starts with the error message "Uncaught Error: Mismatched anonymous define() module: function () {" followed by entire content of velocity.ui.js. It would be nice to have this message go away.

auelia.json snippet:
{ "name": "velocity-animate", "path": "../node_modules/velocity-animate", "main": "velocity", "resources": [ "../../node_modules/velocity-animate/velocity.ui.js" ] },

@EisenbergEffect
Copy link
Contributor

Have you tried the latest version of the CLI? I thought we had fixed the anonymous define issue.

@aidesigner
Copy link
Author

Running CLI 0.17.0, and I am having trouble updating the CLI. It appears each au cli project has aurelia-cli locally installed. Therefore under package.json I change aurelia-cli:"^0.17.0" to "^0.20.0" and ran "npm install aurelia-cli". Now my usual "au run" says invalid command "run", so I had to revert back to 0.17.0. Do I have to set up a new au cli project whenever the CLI is updated?

Also running global aurelia-cli install again seems problematic:
$ au -v
0.20.2

$ npm install aurelia-cli -g
C:\Users\Me\AppData\Roaming\npm
`-- (empty)
npm ERR! Windows_NT 10.0.14931
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "aurelia-cli" "-g"
npm ERR! node v6.2.2
npm ERR! npm v3.9.5
...

@EisenbergEffect
Copy link
Contributor

No. You probably have some sort of cache issue. I think there are issues with npm on windows related to npm cache.

@aidesigner
Copy link
Author

Very well I will work on clearing the cache and see if originally problem is fixed. However I am missing the big picture. Should aurelia-cli be installed globally and locally (ie. "aurelia-cli": "^0.17.0" in package.json)?

@EisenbergEffect
Copy link
Contributor

Yes but the global only defers to the local once the project is created.

On Oct 6, 2016 9:19 PM, "aidesigner" [email protected] wrote:

Very well I will work on clearing the cache and see if originally problem
is fixed. However I am missing the big picture. Should aurelia-cli be
installed globally and locally (ie. "aurelia-cli": "^0.17.0" in
package.json)?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#277 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAIBnQiOnay-ZqxR_wm0ON99eyOeWkPUks5qxchggaJpZM4JigFi
.

@aidesigner
Copy link
Author

The latest CLI corrected the anonymous define issue. To get rid of the npm aurelia-cli update issue I had to change pakage.json from "^0.20.0" to "^0.19.0", and 20.2 was still installed (Strange). Clearing the cache did not help.

The ticket issue is now solved by following the aurelia/animator-velocity#13 workaround. Removing the workaround is being tracked at #309.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants