svelte-websocket-store icon indicating copy to clipboard operation
svelte-websocket-store copied to clipboard

SvelteKit and undefined readyState

Open jaclas opened this issue 2 years ago • 0 comments

I try to use this library, but I get error in browser:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'readyState') at Object.set (index.mjs:80:18)

My code:

const initialValue = { };

if (browser) {
    const myStore = websocketStore("ws://localhost:3000/foo", initialValue);
    myStore.set({
        content: "to be saved",
        other_values: "all"
    });
}

I use latest Svelte's:

❯ npm list
[email protected] /home/jacek/storage/developSSD/epsvelte ├── @sveltejs/[email protected] ├── [email protected] └── [email protected]

jaclas avatar May 24 '22 16:05 jaclas