Skip to content

Cannot require from node #208

@indexzero

Description

@indexzero

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
ReferenceError: document is not defined
    at new Socket (/Users/Charlie/Nodejitsu/node-http-proxy/node_modules/socket.io/node_modules/socket.io-client/lib/socket.js:24:5)
    at Object.connect (/Users/Charlie/Nodejitsu/node-http-proxy/node_modules/socket.io/node_modules/socket.io-client/lib/io.js:169:16)
    at Object.<anonymous> (/Users/Charlie/Nodejitsu/node-http-proxy/examples/standalone-websocket-proxy.js:98:21)
    at Module._compile (module.js:407:26)
    at Object..js (module.js:413:10)
    at Module.load (module.js:339:31)
    at Function._load (module.js:298:12)
    at Array.<anonymous> (module.js:426:10)
    at EventEmitter._tickCallback (node.js:126:26)

Seems like the line in question is: https://github.com/LearnBoost/Socket.IO/blob/master/lib/socket.js#L26

I can define document as a global, but that seems wrong. What's the best approach here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions