Skip to content

Commit

Permalink
fix dependencies & websocket polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
0xSulpiride committed Nov 8, 2023
1 parent 9a1794c commit 200fe1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
"cross-fetch": "3.1.5",
"ethers": "5.7.0",
"graphql-ws": "5.14.2",
"prettier": "2.8.8"
"prettier": "2.8.8",
"reflect-metadata": "0.1.13",
"rxjs": "6.6.7"
},
"devDependencies": {
"@types/node": "18.11.9",
Expand All @@ -79,8 +81,6 @@
"eslint-config-prettier": "6.11.0",
"eslint-plugin-import": "2.20.2",
"npm": "9.6.4",
"reflect-metadata": "0.1.13",
"rxjs": "6.6.7",
"ts-node": "10.9.1",
"typescript": "4.9.5"
}
Expand Down
5 changes: 4 additions & 1 deletion src/node-polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ try {
throw new Error('WebSocket not found. Please install `ws` for node.js');
}

(global as any).WebSocket = WebSocketConstructor;
// browsers don't have the `global` and WebSocket is available in window.WebSocket
if (global) {
(global as any).WebSocket = WebSocketConstructor;
}

0 comments on commit 200fe1e

Please sign in to comment.