Fix playground live reload multiplying connections on error in Chrome and Safari (#238)

This commit is contained in:
Andrew Prifer 2022-06-28 22:17:37 +02:00 committed by GitHub
parent a3d9892841
commit 2b8a1e3ed1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,10 @@ export function createEsbuildLiveReloadTools(): {
break
}
}
es.onerror = attemptConnect
es.onerror = () => {
es.close()
attemptConnect()
}
} catch (err) {
attemptConnect()
}