Skip to content

Instantly share code, notes, and snippets.

@ProjectMoon
Created March 6, 2011 00:03
Show Gist options
  • Save ProjectMoon/856844 to your computer and use it in GitHub Desktop.
Save ProjectMoon/856844 to your computer and use it in GitHub Desktop.
Stack Trace for error
//mg is alias for require('mongoose')
mg.connect('mongodb://localhost/local');
User.find({}, function(errors, users) {
mg.connection.close();
res.render('index', {
title: 'Example Page',
users: users
});
});
Error: Can't use mutable header APIs after sent.
at ServerResponse.getHeader (http.js:521:11)
at ServerResponse.header (/usr/local/lib/node/.npm/express/2.0.0beta/package/lib/response.js:225:17)
at ServerResponse.send (/usr/local/lib/node/.npm/express/2.0.0beta/package/lib/response.js:65:17)
at ServerResponse.render (/usr/local/lib/node/.npm/express/2.0.0beta/package/lib/view.js:301:10)
at ServerResponse.render (/usr/local/lib/node/.npm/express/2.0.0beta/package/lib/view.js:295:10)
at /home/jeff/Programs/JavaScript/scrappersave/src/controllers/UserController.js:11:9
at /usr/local/lib/node/.npm/mongoose/1.1.3/package/lib/mongoose/query.js:558:22
at model.<anonymous> (/usr/local/lib/node/.npm/mongoose/1.1.3/package/lib/mongoose/document.js:141:5)
at model.init (/usr/local/lib/node/.npm/mongoose/1.1.3/package/lib/mongoose/document.js:571:33)
at /usr/local/lib/node/.npm/mongoose/1.1.3/package/lib/mongoose/query.js:556:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment