WebSocket connection to 'ws://127.0.0.1:9944/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED Provider.js:380
See original GitHub issueIn the substrate-front-end-template folder, I cmd’d yarn add @polkadot/api
CHROME
The node runs in one tab of my browser, but a new tab with the same URL comes up which gives me the error:
Error Connecting to Substrate
Error: FATAL: Unable to initialize the API: createType(StorageKey):: Derived TypedArray constructor created an array which was too small
In the console:
WebSocket connection to 'ws://127.0.0.1:9944/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
Provider.js:380
FIREFOX
I got only one tab, with a different error written:
Error Connecting to Substrate
Error: FATAL: Unable to initialize the API: createType(StorageKey):: expected TypedArray of at least length 4, but constructor returned TypedArray of length 0
Console:
API/INIT: Error: FATAL: Unable to initialize the API: createType(StorageKey):: expected TypedArray of at least length 4, but constructor returned TypedArray of length 0
Init.js:85
I read your closed thread about this error, and I assume it’s not an easy one to trace, so hopefully my excessive information can help you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, you can manually fix it - I would always recommend the latest stable version in the case 2.2.1 - https://github.com/polkadot-js/api/releases
Just ensure you change both the
@polkadot/api
&@polkadot/types
lines (they always go hand-in-hand). After that, do ayarn
and it should be ok.This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.