You may have an undefined value that you are trying to pass.
Take for example requires.js :
module.exports = exports = function() { console.log('arguments: %j\n', arguments); };
When you call it correctly, it works:
node > var requires = require('./requires')(0,1,2,3,4,5); arguments: {"0":0,"1":1,"2":2,"3":3,"4":4,"5":5}
If you have a syntax error, it fails:
> var requires = require('./requires')(0,); ... var requires = require('./requires')(0,2); ...
If you have an undefined object, it does not work:
> var requires = require('./requires')(0, undefined); arguments: {"0":0}
So, I first checked that your object was correctly defined (and spelled correctly when you pass it), and then make sure you have no syntax errors.
Jim Schubert Sep 09 '11 at 22:00 2011-09-09 22:00
source share