Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Nowjs : running node and nowjs on a hosted server - error : maximum call stack size exceeded

Nowjs : running node and nowjs on a hosted server - error : maximum call stack size exceeded

Problem

Hello fellow stackers.

I am implementing node.js and nowjs on a website I am working on. I started developing the site weeks ago on localhost and everything was working fine. I transferred the files couple of days ago to a cloud server hosted by rackspace with Ubuntu 12.04 LTS (Precise Pangolin) as OS.

Now I cant get the simple chat example on the nowjs home page to work! I keep getting the following error when I try to run the server side script :

[RangeError: Maximum call stack size exceeded]

There are no recursive loops in my code and I have tried looking for solutions for my problem all over the internet with no luck.

Here are my two example files - a c/p from the chat/helloworld example at the official nowjs site. (http://nowjs.com/doc/example)

server.js

var html = require('fs').readFileSync(__dirname+'/helloworld.html');
var server = require('http').createServer(function(req, res){
  res.end(html);
});
server.listen(8080);

var nowjs = require("now");
var everyone = nowjs.initialize(server);

everyone.now.distributeMessage = function(message){
  everyone.now.receiveMessage(this.now.name, message);
};

helloworld.html




nowjs test

My questions :

  1. Has anyone had the same problem running nowjs on a hosted web server?
  2. Are there any dependencies that I might not be aware of when running nowjs on a hosted web server?

Thank you.

Problem courtesy of: st0ne

Solution

I finally resolved this. All that needed was a reinstallation of node with the most recent stable version(v0.4.12).

Solution courtesy of: st0ne

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Nowjs : running node and nowjs on a hosted server - error : maximum call stack size exceeded

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×