cujojs / when

A solid, fast Promises/A+ and when() implementation, plus other async goodies.
Other
3.44k stars 396 forks source link

Grunt fail to resolve dependencies and combine files #456

Closed podlipensky closed 9 years ago

podlipensky commented 9 years ago

I installed whenjs via bower and added it to my require config:

{
        name: 'when',
        location: '../../../bower_components/when',
        main: 'when'
}

Now I'm trying to combine everything into one file using grunt and I get this error:

Tracing dependencies for: common/main
{ [Error: Error: Non-existent context variable used in file project/tmp/js/../../../bower_components/when/lib/Scheduler.js: "run:function"
Make sure you have the variable both in the server manifest and default.yaml file.
]
  originalError:
   [Error: Non-existent context variable used in file project/tmp/js/../../../bower_components/when/lib/Scheduler.js: "run:function"
   Make sure you have the variable both in the server manifest and default.yaml file.] }
Fatal error: Project "project" encountered an error.

Any help will be appreciated

briancavalier commented 9 years ago

Hi @podlipensky, a few quick questions that may help us figure out what's going on.

What grunt plugin are you using to build? When.js works well with r.js, browserify, web pack, and others, so maybe it's something about your particular configuration.

When you say "require config", do you mean RequireJS config? If so, did you configure when.js as a package or a path? Looking at the config snippet you pasted, it appears you used a package (which is correct), but I just want to verify.

Thanks!

podlipensky commented 9 years ago

nvm, looks like it was interfering with another module. Thanks for response anyway

briancavalier commented 9 years ago

No prob, glad you figured it out!