michaelwittig / node-q

Q interfacing with Node.js
MIT License
52 stars 14 forks source link

problem with the net module when used inside react app #59

Closed bitcorr closed 2 years ago

bitcorr commented 2 years ago

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?

michaelwittig commented 2 years ago

This library is not intended to work in the browser. AFAIK, q can be accessed via websocket which would be an option.