Closed callmearta closed 3 years ago
Which Node version are you on?
14.15.0 I also upgraded node to 16.2.0 but still had no luck. Currently i installed version 0.2.16 of your lib and there's not this error anymore but i still can't get it working :)) It's giving me this error on version 0.2.16:
mqtt.client.ts:399 Uncaught (in promise) TypeError: Illegal invocation
at MQTToTClient.setConnected (mqtt.client.ts:399)
at MQTToTClient.handlePacket (mqtt.client.ts:328)
This is the screenshot of the error. also i tried using debugging but no more information came out of it. So i think something goes wrong before it reaches your lib to debug it. Are the examples up to date with latest version of instagram-private-api? I think maybe there's something happening. this is my code:
const = withFbnsAndRealtime(new IgApiClient());
ig.state.generateDevice(username);
await ig.simulate.preLoginFlow();
...LoginThings....
ig.realtime.on('error', console.error);
ig.realtime.on('receive', console.log);
await ig.realtime.connect();
Are you running this in the browser or the background process?
I'm running it in react wrapped in electron js so it should be running in browser. Although i can't see the request in network tab
This library relies on node-streams, so you can't run it in the browser. Furthermore, it uses raw TCP/TLS to connect to Instagram which the browser just cannot do.
Let me check to assure. At the time being thank you for responding. I think it's running under node because it's request is not visible in networks tab
@Nerixyz I checked it and it's running under node not browser. Still getting this error when using latest version of your package:
index.js:181 TypeError: stream.on is not a function
at destroyer (internal/streams/pipeline.js:27)
at internal/streams/pipeline.js:88
at Array.map (<anonymous>)
at Function.pipeline (internal/streams/pipeline.js:85)
at MQTToTClient.createPipeline (mqtt.client.js:110)
at MQTToTClient._connect (mqtt.client.js:95)
at async MQTToTClient.connect (mqtt.client.js:100)
Did you try it in vanilla-node?
@Nerixyz No. I tried to test your own example but couldn't get it working because of no babel or webpack. Still that old version doesn't throw this error. But also that one doesn't work. I've been stuck for almost 7 hours now :))
because of no babel or webpack
You don't need babel or webpack. You just need typescript. Just do npm i instagram_mqtt instagram-private-api
edit some constants and run it.
I did what you said and it works. Then why doesn't it work when it's wrapped in electron?
Yea there's definitely something wrong with wrapping in electron. do you have any suggestions to use MQTT like Instagram web direct so it can be used in web browsers?
14.15.0
That's wrong. You've used Node 12 (See this run on node 12; the next run on node 14 was sucessful)
@Nerixyz It says 14.15.0 mate. Also i've tried installing node again.
It says 14.15.0 mate. Also i've tried installing node again.
Yeah but there's no version of Node 14 where there's a call to stream.on
(the stacktrace you sent) on line 27 in internal/streams/pipeline.js
.
Finally!!!!!! Thank you mate. The problem was the fact that electron had packed it's own version of Node and was using version 12.8! I didn't know it does such a thing. Finally after 12 hours :)) Thanks again
thanks for you answers. electron@12 is fine!
Hi, I've been trying for couple hours now to get your library working. I'm using instagram-private-api and it's working fine and returns direct messages and everything. Although when i try to use your library this happens:
I'm using this line to wrap the IgApiClient:
Could you help me out please? Also I'm using electron, maybe there's something happening in there.