problem with the net module when used inside react app
Closed this issue · 1 comments
Hi, I use node-q to send queries to kdb+ db. I created a code that worked when I executed it directly from cmd (i.e. "node sendQuery.js" on terminal).
For some reason, when used inside react app, the exact same code gives an error TypeError: Cannot read property 'apply' of undefined
.
This is the traceback, on node_modules/node-q/index.js:241
:
238 | });
239 | }
240 | });
241 | socket = net.connect.apply(null, socketArgs); // problem in this line.
242 | if (params.socketTimeout !== undefined) {
243 | socket.setTimeout(params.socketTimeout);
244 | }
Do you have any idea why this happens? or how can I solve this?
This library is not intended to work in the browser. AFAIK, q can be accessed via websocket which would be an option.