Skip to content

Commit b4b9c59

Browse files
committed
chore: fix type constraint after type upgrade
1 parent 4649a7f commit b4b9c59

File tree

1 file changed

+2
-1
lines changed
  • packages/vite/src/node/server

1 file changed

+2
-1
lines changed

packages/vite/src/node/server/ws.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import WebSocket from 'ws'
88
import { ErrorPayload, HMRPayload } from 'types/hmrPayload'
99
import { ResolvedConfig } from '..'
1010
import { isObject } from '../utils'
11+
import { Socket } from 'net'
1112
export const HMR_HEADER = 'vite-hmr'
1213

1314
export interface WebSocketServer {
@@ -30,7 +31,7 @@ export function createWebSocketServer(
3031
wss = new WebSocket.Server({ noServer: true })
3132
wsServer.on('upgrade', (req, socket, head) => {
3233
if (req.headers['sec-websocket-protocol'] === HMR_HEADER) {
33-
wss.handleUpgrade(req, socket, head, (ws) => {
34+
wss.handleUpgrade(req, socket as Socket, head, (ws) => {
3435
wss.emit('connection', ws, req)
3536
})
3637
}

0 commit comments

Comments
 (0)