-1

I am on the first tutorial of Substrate, running substrate on Windows Subsystem for Linux. The substrate network is running correctly, but when I open the frontend on the browser i get this erros:

enter image description here

enter image description here

Mvrocha
  • 393
  • 3
  • 14

3 Answers3

1

Because you run on the subsystem I would recommend you to check the network configuration for that. here is my be help : Sharing Network Resources WSL

Ayoung
  • 23
  • 4
0

I have encountered and resolved this problem. WSL share the same ip with host, you known. you should make sure weather your wsl's ip is the same one that your frontend connect to. Generally, it is same one. I just closed the wls terminal console window and reopen it, it can be works! I don't know why, Perhaps, the bugs of wsl lead to it. Good Luck, guy!

0

From what I've experienced, getting Windows and WSL communicating through localhost is tricky and prone to falling over. I resolved the issue by making use of WSL's internal network IP address.

When you run the front-end server (yarn start) it shows you the internal network IP you can use to open the frontend. Or you can run

ip addr | grep -E "\b*inet.*global" | sed -E s/inet(.*)\/.*/\1/

(which I got from https://github.com/microsoft/WSL/issues/4636)

Next, you have to run the node-template with the --ws-external flag (in addition to the --dev and --tmp flags), so that it binds to 0.0.0.0 and allows you to connect to from windows.

Finally, you have to edit the src/config/development.json so that the PROVIDER_SOCKER variable uses the internal IP address and not 127.0.0.1.

djoub
  • 1
  • 3