You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can connect via Websocket Provider using url with credentials 'wss://USERNAME:PASSWORD@WSS_ENDPOINT'
Actual behavior
Received TypeError: Illegal invocation
Seems like 'btoa' this isn't pointing to Window object as it should but to WebsocketProvider's object
NOTE: Binding 'btoa' to Window object in 'helpers.js' solves the issue _btoa = btoa.bind(window); (web3-providers-ws/src/helpers.js:21)
Locking context with arrow function also works _btoa = (str) => btoa(str); (web3-providers-ws/src/helpers.js:21)
Steps to reproduce the behavior
Try to connect to url type of 'wss://USERNAME:PASSWORD@WSS_ENDPOINT' using WebsocketProvider (web version)
Logs
TypeError: Illegal invocation
new WebsocketProvider
node_modules/web3-providers-ws/src/index.js:73
Expected behavior
I can connect via Websocket Provider using url with credentials 'wss://USERNAME:PASSWORD@WSS_ENDPOINT'
Actual behavior
Received TypeError: Illegal invocation
Seems like 'btoa'
this
isn't pointing to Window object as it should but to WebsocketProvider's objectNOTE: Binding 'btoa' to Window object in 'helpers.js' solves the issue
_btoa = btoa.bind(window);
(web3-providers-ws/src/helpers.js:21)Locking context with arrow function also works
_btoa = (str) => btoa(str);
(web3-providers-ws/src/helpers.js:21)Steps to reproduce the behavior
Logs
Environment
web3.js: 1.2.7
Chrome: 81.0
OS: MacOS Catalina (10.15.4 )
The text was updated successfully, but these errors were encountered: