Closed gempir closed 4 years ago
8896b8be1cc374510dc98c462044ef5b3abbb28e fixed it and it's now in 3.2.6
Hello, How do you run it in browser ? I tried jsdelivr, without success. Thanks
You need to initialize it with websocket configuration option https://github.com/gempir/raftchat/blob/master/src/state/Store.tsx#L19
new ChatClient({
connection: {
type: "websocket",
secure: true,
}
})
I mean, ChatClient
is undefined in the first place 😅
You need a bundler and then import it.
import { ChatClient } from "dank-twitch-irc";
You mean I can't do it without webpack ? :/
I can't do it in vanilla JS, for a userscript ?
By default this library isn't compatible in that way I think, so no. Needs to be some sort of module thingy not 100% sure, I always use a bundler
Yes, this library wasn't originally meant to run natively in the browser. However with the websocket configuration option you can make it work, if you use a bundler like webpack or parcel.
When running dank-twitch-irc in a browser that has no ES2018 support (like Firefox) it will crash because of some regexp issue.
It would be nice if dank-twitch-irc supported most major browsers and recent versions of them.