I'm having trouble with trying to get the stomp client to work with SvelteKit, because of "WebSocket not defined" error. From a bit of research, this seems to because of how Node is involved, but I can't find any help on how to either stop Node from trying to process the module, or get some kind of polyfil so that it will load. Any suggestions?
<script lang="ts">
import * as Stomp from 'stompjs';
...
const client = Stomp.client(url);
client.connect(headers, () => { console.log('connected'); })
Getting the error message:
9:17:24 am [vite] page reload src/routes/index.svelte (x5)
WebSocket is not defined
ReferenceError: WebSocket is not defined