Closed billygerhard closed 4 years ago
When using tmi.js inside an Angular application, the TMI client is checking for global, which was removed from Angular. Angular uses window.
client.js line 7 var ws = global.WebSocket || global.MozWebSocket || require("ws");
var ws = global.WebSocket || global.MozWebSocket || require("ws");
I fix this in my index.html with
<script> if(window['global'] === undefined){ window['global'] = window } </script>
but can easily be fixed with var global = global || window; before initializing ws on line 7.
var global = global || window;
Server configuration
When using tmi.js inside an Angular application, the TMI client is checking for global, which was removed from Angular. Angular uses window.
client.js line 7
var ws = global.WebSocket || global.MozWebSocket || require("ws");
I fix this in my index.html with
but can easily be fixed with
var global = global || window;
before initializing ws on line 7.Server configuration