NowJs on Heroku

204 views
Skip to first unread message

Zeeshan Hanif

unread,
Feb 5, 2012, 7:37:25 AM2/5/12
to nowjs

I wanted to up my app on Heroku but while upload my app on heroku its
give error which can be seen by 'heroku logs' command.
Below is the error

2012-02-05T11:17:09+00:00 app[web.1]: message: '/app/node_modules/
now/bin/proxy.node: invalid ELF header' }
2012-02-05T11:17:09+00:00 app[web.1]: Error: /app/node_modules/now/bin/
proxy.node: invalid ELF header
2012-02-05T11:17:09+00:00 app[web.1]: at Module.load (module.js:
336:31)
2012-02-05T11:17:09+00:00 app[web.1]: at Function._load (module.js:
297:12)
2012-02-05T11:17:09+00:00 app[web.1]: at require (module.js:
348:19)
2012-02-05T11:17:09+00:00 app[web.1]: at Object..node (module.js:
416:11)
2012-02-05T11:17:09+00:00 app[web.1]: at Object.<anonymous> (/app/
node_modules/now/lib/proxy.js:10:13)
2012-02-05T11:17:09+00:00 app[web.1]: at Module._compile
(module.js:404:26)
2012-02-05T11:17:09+00:00 app[web.1]: at Module.load (module.js:
336:31)
2012-02-05T11:17:09+00:00 app[web.1]: at Object..js (module.js:
410:10)
2012-02-05T11:17:09+00:00 app[web.1]: at Function._load (module.js:
297:12)
2012-02-05T11:17:09+00:00 app[web.1]: at require (module.js:
348:19)
2012-02-05T11:17:09+00:00 app[web.1]: Listening on 52783

It seems to me that it is the same error which occur on nowjs
installation with npm command and nowjs team have provided alternate
for installation.

Kindly guide me how can i resolve this issue on heroku.


Regards,
Zeeshan Hanif

Eric Zhang

unread,
Feb 6, 2012, 7:40:05 PM2/6/12
to no...@googlegroups.com
Hi,

Looks like you're pushing the node_modules folder as part of your website, make sure to specify which npm modules you need according to heroku's instructions but not to push the node_modules folder.
Specifically your error is due to you pushing the binary nowjs dependency 'node-proxy`, which cannot run on heroku's systems dude to different architectures between your computer and there servers.


Eric
--
Co-Founder @ Flotype, makers of NowJS

Zeeshan Hanif

unread,
Feb 8, 2012, 11:45:37 AM2/8/12
to no...@googlegroups.com
Thanks ,

That problem resolved, but now I ran into another problem, my browser say it is unable to find method that is attached with 'now'.
Such as 'addUserList', this method is declared on server in and im calling it from client as 'now.addUserList()' but it says undefined method.

Can you help in this is?


Regards,
Zeeshan Hanif

Zeeshan Hanif

unread,
Feb 8, 2012, 11:53:05 AM2/8/12
to no...@googlegroups.com
The accurate error msg is "Uncaught TypeError: Object #<Object> has no method 'addUserList' " and line number it is pointing to is written as 'now.addUserList(now.name)'

Regards,
Zeeshan Hanif

Eric Zhang

unread,
Feb 8, 2012, 12:27:27 PM2/8/12
to no...@googlegroups.com
Hi Zeeshan,

Are you calling it immediately on page load? If so it must be inside a now.ready(function() { .... }); block in order to ensure that nowjs has fully loaded


Eric

Zeeshan Hanif

unread,
Feb 8, 2012, 12:36:11 PM2/8/12
to no...@googlegroups.com
Eric,

Its not in now.ready(function() {...}); function but it is in other function which is called on user click action 

 function userName(event){

        if($("#name").val().trim() == "") {
            return false;
        }

        now.name = $("#name").val();
        $("#name").val("");

        now.addToUserList(now.name);

        $("#userNameDiv").hide();
        $("#nameResult").show();
        $("#nameResult").html("User Name: "+now.name);
        $("#message").removeAttr("disabled");
        //alert("user name");
        return false;

    }

That 'userName' function is called when user clicked on button.
Is it require to add this function too in now.ready(function() {...}) ?


Regards,
Zeeshan Hanif

Zeeshan Hanif

unread,
Feb 8, 2012, 1:43:50 PM2/8/12
to no...@googlegroups.com
Eric,

Do not confuse with method name as addUserList or addToUserList. Below is the correct version.
I was trying to use other name to verify.

 function userName(event){

        if($("#name").val().trim() == "") {
            return false;
        }

        now.name = $("#name").val();
        $("#name").val("");

        now.addUserList(now.name);

        $("#userNameDiv").hide();
        $("#nameResult").show();
        $("#nameResult").html("User Name: "+now.name);
        $("#message").removeAttr("disabled");
        //alert("user name");
        return false;

    }


Regards,
Zeeshan Hanif
Reply all
Reply to author
Forward
0 new messages