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
in work.js,i used useWebsocket,the socket connect successfully,but when i want to use the websocket
response data , an error message appears : window in not defined
here is my worker.js import {useWebsocket} from @vueuse/core self.addEventlistener('message',(e) => { const {data} = useWebsocket(e.data.url,{ autoReconnect:{delay:3000}, onConnected:(ws) => { const sub = JSON.stringify({xxxx}) ws.send(sub) } }) // ----- error here : console.log(data) ---- })
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a VueUse issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
Check that this is a concrete bug. For Q&A open a GitHub Discussion.
Describe the bug
in
work.js
,i useduseWebsocket
,the socket connect successfully,but when i want to use the websocketresponse data , an error message appears :
window in not defined
here is my
worker.js
import {useWebsocket} from @vueuse/core self.addEventlistener('message',(e) => { const {data} = useWebsocket(e.data.url,{ autoReconnect:{delay:3000}, onConnected:(ws) => { const sub = JSON.stringify({xxxx}) ws.send(sub) } }) // ----- error here : console.log(data) ---- })
Reproduction
none
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: