tmijs / tmi.js

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

undefined is not a function #86

Closed cach116 closed 8 years ago

cach116 commented 8 years ago

I updated my development code to the latest tmi.js and I am getting this error every few seconds:

Uncaught TypeError: undefined is not a function url: https://localhost:3000/static/js/tmi.min.js line: 1 column: 69 error: TypeError: undefined is not a function

I am using it in a browser using the tmi.min.js file that is in the dist folder.

Schmoopiie commented 8 years ago

We are providing a SourceMap to help debug your application/website when this kind of error occurs. Use <script src="//cdn.tmijs.org/js/latest/tmi.min.js"></script> and place the SourceMap on your server and inspect the error.

cach116 commented 8 years ago

Line 696 of /lib/client.js is where the error is coming from

if (this.getUsername().includes("justinfan") && this.username === message.prefix.split("!")[0]) {

image

Schmoopiie commented 8 years ago

I see, I will update the bundle very soon with a small fix, I will keep you updated here.

cach116 commented 8 years ago

Great :D

You're amazing Schmoopiie

Schmoopiie commented 8 years ago

There you go, make sure you clear the cache of your browser and everything should be working. The error was because includes() is not supported on IE.. I was only able to test the bundle with Edge, Chrome and FireFox.

cach116 commented 8 years ago

Thanks again. I wasn't using IE but I am using Chromium 37, which also doesn't support includes().

It seems to be fixed.

Schmoopiie commented 8 years ago

:smile: :+1: