File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,4 @@ import { extractGlobal } from '@polkadot/x-global';
77
88export { packageInfo } from './packageInfo.js' ;
99
10- /**
11- * The built-in `globalThis.WebSocket` in Node.js 22+ does not provide
12- * detailed error messages (e.g., `ECONNREFUSED` or `ETIMEDOUT`), making
13- * it difficult to implement proper reconnection logic.
14- *
15- * To avoid these issues, we explicitly use the `ws` library in Node.js 22+
16- * while still preserving support for the browser WebSocket API in browser environments.
17- *
18- * Related Issue: https://github.com/polkadot-js/common/issues/1975
19- */
20- const isNode22 = typeof process !== 'undefined' && parseInt ( process . versions ?. node ?. split ( '.' ) [ 0 ] || '0' , 10 ) >= 22 ;
21-
22- export const WebSocket = isNode22 ? ( ws as unknown as typeof globalThis . WebSocket ) : /*#__PURE__*/ extractGlobal ( 'WebSocket' , ws ) ;
10+ export const WebSocket = /*#__PURE__*/ extractGlobal ( 'WebSocket' , ws ) ;
You can’t perform that action at this time.
0 commit comments