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

undefined is not a function #96

Open
voltairemakeit opened this issue Jul 7, 2016 · 0 comments
Open

undefined is not a function #96

voltairemakeit opened this issue Jul 7, 2016 · 0 comments

Comments

@voltairemakeit
Copy link

Hi,

Keystonejs (yo generator) is working perfectly.

When I try to install sydjs
I get the following error when I run node keystone.js :

undefined is not a function

    at exports.flashMessages (/var/www/vhosts/ichesspro.com/nodejs.ichesspro.com/opt/node-services/routes/middleware.js:98:26)

    at /var/www/vhosts/ichesspro.com/nodejs.ichesspro.com/opt/node-services/node_modules/keystone/lib/view.js:354:4

    at /var/www/vhosts/ichesspro.com/nodejs.ichesspro.com/opt/node-services/node_modules/keystone/node_modules/async/lib/async.js:718:13

    at async.forEachOf.async.eachOf (/var/www/vhosts/ichesspro.com/nodejs.ichesspro.com/opt/node-services/node_modules/keystone/node_modules/async/lib/async.js:233:13)

    at _parallel (/var/www/vhosts/ichesspro.com/nodejs.ichesspro.com/opt/node-services/node_modules/keystone/node_modules/async/lib/async.js:717:9)

    at Object.async.parallel (/var/www/vhosts/ichesspro.com/nodejs.ichesspro.com/opt/node-services/node_modules/keystone/node_modules/async/lib/async.js:731:9)

    at /var/www/vhosts/ichesspro.com/nodejs.ichesspro.com/opt/node-services/node_modules/keystone/lib/view.js:364:10

    at /var/www/vhosts/ichesspro.com/nodejs.ichesspro.com/opt/node-services/node_modules/keystone/node_modules/async/lib/async.js:181:20

    at Immediate.iterate [as _onImmediate] (/var/www/vhosts/ichesspro.com/nodejs.ichesspro.com/opt/node-services/node_modules/keystone/node_modules/async/lib/async.js:262:13)

    at processImmediate [as _immediateCallback] (timers.js:358:17)

Middleware.js

**
 Fetches and clears the flashMessages before a view is rendered
*/


exports.flashMessages = function(req, res, next) {
 var flashMessages = {
 info: req.flash('info'),
 success: req.flash('success'),
 warning: req.flash('warning'),
 error: req.flash('error')
 };
 res.locals.messages = _.any(flashMessages, function(msgs) { return msgs.length }) ? flashMessages : false;
 next();
};

I tried with [email protected] and the last stable

node v0.12.4

npm 2.10.1

MongoDB 3.2.7

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

1 participant