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: Object #<Object> has no method 'listen' #37

Open
codesplicer opened this issue Jun 23, 2011 · 4 comments
Open

TypeError: Object #<Object> has no method 'listen' #37

codesplicer opened this issue Jun 23, 2011 · 4 comments

Comments

@codesplicer
Copy link

Keep getting this error when running the following code against my expressjs app:

var app     = require('../app'),
    assert  = require('assert'),
    tobi    = require('tobi'),
    vows    = require('vows'),
    browser = tobi.createBrowser(app);

browser.get('/login', function(res, $){
});

Not sure what's causing this behavior.

@tj
Copy link
Contributor

tj commented Jun 23, 2011

hmm can you post the stack trace?

@codesplicer
Copy link
Author

Error: Debug
    at Object.<anonymous> (/Users/vik/local_repository/myapp/test/app.test.js:16:10)
    at Module._compile (module.js:404:26)
    at Object..js (module.js:410:10)
    at Module.load (module.js:336:31)
    at Function._load (module.js:297:12)
    at Array.0 (module.js:423:10)
    at EventEmitter._tickCallback (node.js:126:26)
Caught exception: TypeError: Object #<Object> has no method 'listen'

@toxin20
Copy link

toxin20 commented Dec 31, 2011

did you solve your problem?

i get the same message using tobi (same code as above). weird thing i also get this using zombiejs or mocha testing tools.

i'm using node 0.6.2 on ubuntu 10.04 and got the modules via npm install

@nagyv
Copy link

nagyv commented Feb 16, 2012

probably you do not export your app from your server

app     = require('../app'),

you should check what app is, my guess is that it's {}

what can you do? simply write in your ../app the following:

var app = module.exports = express.createServer();

to get your app exported

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

4 participants