mauricemach / zappa

Node development for the lazy.
zappajs.org
MIT License
951 stars 85 forks source link

jquery and socket.io include order important #60

Open iangreenleaf opened 13 years ago

iangreenleaf commented 13 years ago

I'm not even sure if this is a zappa bug, but it certainly caught me off guard. I hit problems when I included jquery before socket.io like so:

    script src: '/zappa/jquery.js'
    script src: '/socket.io/socket.io.js'

That causes the following in the browser console:

Uncaught ReferenceError: io is not defined
    (anonymous function)                                        socket.io.js:463
 Uncaught ReferenceError: io is not defined
    zappa.run.root_locals.connect                               zappa.js:1
    (anonymous function)                                        :3
    anonymous                                                   :17
    zappa.run                                                   zappa.js:1
    (anonymous function)                                        index.js:1

Switching the order of those two scripts resolves the error. Any idea why this is happening?

mauricemach commented 13 years ago

I stumbled upon this issue too but didn't investigate it yet. I'll let you know if I do.