tmijs / tmi.js

💬 Javascript library for the Twitch Messaging Interface. (Twitch.tv)
https://tmijs.com
MIT License
1.54k stars 216 forks source link

1.7.0 Browser Version not working #444

Closed ZeAntwan closed 3 years ago

ZeAntwan commented 3 years ago

I am trying to use the Brower version of TMI, but I'm unable to connect to the chat correctly as the script throws a connection error, being unable to check "isConnected"

Some investigation led to maybe find a scope issue in the tmi.js browser version at line 315 where the loop function seems to lose/or not be in the correct scope (bad assumptions here, I don't know much about JS).

And there is also a hug error spam about the "_typeof" function exceeding the maximum call stack size

Actual behaviour: The script doesn't connect and starts with an error spam

Uncaught TypeError: Cannot read property '_isConnected' of undefined
    at Object.fn (tmi.js:320)
    at queue.next (tmi.js:2949)
    at queue.run (tmi.js:2934)
    at client.handleMessage (tmi.js:332)
    at tmi.js:1303
    at Array.forEach (<anonymous>)
    at client._onMessage (tmi.js:1301)
[00:23] info: Connecting to irc-ws.chat.twitch.tv on port 443..
[00:23] info: Sending authentication to server..
[00:23] info: Connected to server.
Uncaught TypeError: Cannot read property '_isConnected' of undefined at Object.fn (tmi.js:320)

Expected behaviour: The scripts connects and handles chat messages and others events

[00:08] info: Connecting to irc-ws.chat.twitch.tv on port 443..
[00:08] info: Sending authentication to server..
[00:08] info: Connected to server.
[00:08] info: Executing command: JOIN #stuffmakerco

Error log:

Uncaught RangeError: Maximum call stack size exceeded  at _typeof (tmi.js:2273)
Uncaught TypeError: Cannot read property '_isConnected' of undefined
    at Object.fn (tmi.js:320)
    at queue.next (tmi.js:2949)
    at queue.run (tmi.js:2934)
    at client.handleMessage (tmi.js:332)
    at tmi.js:1303
    at Array.forEach (<anonymous>)
    at client._onMessage (tmi.js:1301)

Server configuration

AlcaDesign commented 3 years ago

See the release page for v1.7.1 or v1.7.0 for updated builds.