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
<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.
Server configuration
- Operating system: Windows 10
- Node version (if applicable): 10.16.3
- NPM version (if applicable): 6.13.0
- tmi.js version: 1.5.0