Skip to content

Instantly share code, notes, and snippets.

@santiago
Created November 3, 2010 23:10
Show Gist options
  • Save santiago/661878 to your computer and use it in GitHub Desktop.
Save santiago/661878 to your computer and use it in GitHub Desktop.
Working OK in OSX, but ain't working in Ubuntu 10.04
app.configure(function(){
app.use(express.bodyDecoder());
});
app.put('/admin/couple_fun/games', function(req, res) {
var game= {};
var game_data= req.param('game');
Game.findById(game_data.id, function(game) { // <----- Error is here (line 44) game_data is undefined
set_game(game, game_data);
game.save(function(a){});
});
res.send([]);
});
TypeError: Cannot read property 'id' of undefined
at Object.<anonymous> (/home/devel/Install/couplespace/couple_fun/main.js:44:28)
at pass (/home/devel/.node_libraries/connect/middleware/router.js:70:27)
at Object.router [as handle] (/home/devel/.node_libraries/connect/middleware/router.js:85:10)
at next (/home/devel/.node_libraries/connect/index.js:244:23)
at IncomingMessage.<anonymous> (/home/devel/.node_libraries/connect/middleware/bodyDecoder.js:51:17)
at IncomingMessage.emit (events:27:15)
at HTTPParser.onMessageComplete (http:107:23)
at Stream.ondata (http:765:22)
at IOWatcher.callback (net:510:29)
at node.js:608:9
@santiago
Copy link
Author

santiago commented Nov 3, 2010

Here's how the req looks in Ubuntu ... (seems OK :S)
https://gist.github.com/661895

And here's how it looks in OSX
https://gist.github.com/661901

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment