The console repeatedly outputs WebSocketClient.js?5586:16 WebSocket connection to 'ws://10.22.219.126:8080/ws' failed:
Open the vue project today, the project runs fine, but it keeps outputting this error repeatedly, which is very uncomfortable, as follows:
Found a workaround that works:
Configure the following code in vue.config.js:
devServer: {
host: '0.0.0.0',
port: 3000,
client: {
webSocketURL: 'ws://0.0.0.0:3000/ws',
},
headers: {
'Access-Control-Allow-Origin': '*',
}
}