You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately useState can't store data that can't be serialized as said there : ...anything that cannot be serialized, such as classes, functions or symbols.
I already tried using a /composable/sharedSocket.ts but it throws warning when i try to watch the composable's returned values such as status ref, suggesting that the reactivity may be broken :
I have already thought about opening/closing connection for each page
So my question, is there a way to share a single websocket connection through layout/pages ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using Nuxt with Nitro's WebSocketAPI
Unfortunately
useState
can't store data that can't be serialized as said there :...anything that cannot be serialized, such as classes, functions or symbols.
I already tried using a
/composable/sharedSocket.ts
but it throws warning when i try to watch the composable's returned values such asstatus
ref, suggesting that the reactivity may be broken :I have already thought about opening/closing connection for each page
So my question, is there a way to share a single websocket connection through layout/pages ?
Beta Was this translation helpful? Give feedback.
All reactions