Open mStirner opened 8 years ago
I'm hitting the same issue in a WebWorker in an iOS webview
+1
Same issue when importing json3
in a web worker using parcel
.
The same problem,in Electron,use SocketIO through webWorker,:
import { BitcoreBlockchain } from 'hd-wallet'
import SocketWorker from 'worker-loader?name=js/socketio-worker.[hash].js!hd-wallet/lib/socketio-worker/inside'
const blockchain = new BitcoreBlockchain(['https://btc4.trezor.io'], () => new SocketWorker())
https://github.com/trezor/hd-wallet
Solution: nodeIntegrationInWorker: true
https://github.com/electron/electron/blob/master/docs/tutorial/multithreading.md
Hay, i have a little problem.
I cant use json3 (socket.io, btw. socket.io-client) 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" (https://github.com/felixge/node-sandboxed-module)
See other issue on: https://github.com/socketio/socket.io/issues/2381#issuecomment-172353479