diff --git a/CHANGELOG.md b/CHANGELOG.md index fcb3c3d321..21f4513996 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # viem +## 1.10.8 + +### Patch Changes + +- [#1177](https://github.com/wagmi-dev/viem/pull/1177) [`8d05e410`](https://github.com/wagmi-dev/viem/commit/8d05e410e1db43cbcddab2741e1f7dc22b5ffbec) Thanks [@jxom](https://github.com/jxom)! - Fixed an issue where some environments would throw `WebSocket.default is not a constructor`. + ## 1.10.7 ### Patch Changes diff --git a/package.json b/package.json index c3770852fb..8644f09e8e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "viem", "description": "TypeScript Interface for Ethereum", - "version": "1.10.7", + "version": "1.10.8", "scripts": { "bench": "vitest bench", "bench:ci": "CI=true vitest bench", diff --git a/src/errors/version.ts b/src/errors/version.ts index ba3c62ef6d..397bfcf040 100644 --- a/src/errors/version.ts +++ b/src/errors/version.ts @@ -1 +1 @@ -export const version = '1.10.6' +export const version = '1.10.8' diff --git a/src/utils/rpc.ts b/src/utils/rpc.ts index 0bf84e9dd4..0a8b05309d 100644 --- a/src/utils/rpc.ts +++ b/src/utils/rpc.ts @@ -156,7 +156,9 @@ export async function getSocket(url: string) { const { schedule } = createBatchScheduler({ id: url, fn: async () => { - const webSocket = new WebSocket(url) + let WebSocket_ = WebSocket + if (!WebSocket.constructor) WebSocket_ = WebSocket.WebSocket + const webSocket = new WebSocket_(url) // Set up a cache for incoming "synchronous" requests. const requests = new Map()