-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socket.io dosn't run in VM "sandboxed-module" #2381
Comments
I found a "Quick & Dirty" Solution: The problem is the "json3" module. context || (context = root["Object"]());
exports || (exports = root["Object"]()); this line: root = global; final: root = global;
context || (context = root["Object"]());
exports || (exports = root["Object"]()); Now it works, but is this the fine way ? |
This one https://github.com/felixge/node-sandboxed-module ? I'm not familiar with the module, but that sounds the issue of vm module to me. |
Yep., it is the module. |
I'm not sure if the vm module is wrong, but I don't think we can do something to solve the problem. Can you create the issue on |
json3 module issues: bestiejs/json3#86 |
I'm hitting exactly the same issue in a WebWorker with [email protected]. Trying to figure out a work around. The issue seems to originate from json3. At least I can still downgrade back to [email protected], it was working fine on that version. |
@dozoisch cheers, looking at a workaround as well but rolling back to 1.3.7 sorted the issue for now. 👍 |
It's |
That issue was closed automatically. Please check if your issue is fixed with the latest release, and reopen if needed (with a fiddle reproducing the issue if possible). |
Hay, i have a little problem.
I cant use socket.io inside a node js VM.
When i run it i become this error: "TypeError: Cannot read property 'prototype' of undefined"
/home/marc/NetBeansProjects/Project/node_modules/socket.io-client/node_modules/json3/lib/json3.js:50
var objectProto = Object.prototype,
^
TypeError: Cannot read property 'prototype' of undefined
at runInContext (/home/marc/NetBeansProjects/Project/node_modules/socket.io-client/node_modules/json3/lib/json3.js:50:29)
As VM i use the module "sandboxed-module"
The text was updated successfully, but these errors were encountered: