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

TypeError, undefined property in non-clustered mode using express #30

Open
simonrw opened this issue Jan 22, 2013 · 1 comment
Open

Comments

@simonrw
Copy link

simonrw commented Jan 22, 2013

The express example in the documentation throws an exception with the cluster option cluster: false

Server code

var Cluster = require('cluster2');
var express = require('express');

var app = express();
app.get('/', function(req, res) {
    res.send('hello');
});

var c = new Cluster({
    port: 3000,
    cluster: false
});

c.listen(function(cb) {
    cb(app);
});

Error

TypeError: Cannot read property 'app' of undefined
    at exports.enable (/private/tmp/node_modules/cluster2/lib/ecv.js:37:30)
    at Function._.each._.forEach (/private/tmp/node_modules/cluster2/node_modules/underscore/underscore.js:81:22)
    at Object.exports.enable (/private/tmp/node_modules/cluster2/lib/ecv.js:36:7)
    at Server.Cluster.listen.createApp.call.ports (/private/tmp/node_modules/cluster2/lib/index.js:107:25)
    at Server.g (events.js:192:14)
    at Server.EventEmitter.emit (events.js:93:17)
    at Server._listen2 (net.js:923:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

Versions

  • node v0.8.16
  • express v3.0.6
  • cluster2 v0.3.8
@shimonchayim
Copy link
Member

Got it fixing it ...

@alumowa alumowa mentioned this issue Mar 8, 2013
s3u added a commit that referenced this issue Mar 3, 2014
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

2 participants