Strapi Version: 3.6
Operating System: Windows 8.1 pro
Database: Sqlite3 5.0.2
Node Version: 14.8.0
NPM Version: 6.14.7
Yarn Version: 1.22.10
Hello good people,
Would someone know how I could run strapi using codesandbox? I found a sandbox template created by
Olicpg but when I run
yarn start, it gives me a
localhost refused to connect error in the browser yet the server is running just fine. I tried updating the dependencies but it didn’t change anything. Any help with this would be highly appreciated.
P.S: I’m not using the local installation because it threw me a
sharp module that wasn't being found error when I used the quickstart approach, I tried different approaches to fix it referring to the sharp installation guide but didn’t get any luck with it. If you would know how to fix this issue, it would also be very helpful and please do let me know if you need me to elaborate more, thank you!
Generally this happens when the service running on your localhost has some problem resolving the request. If you have access to logs, please see logs for more details on the error. Also, make sure the application interface, server, and services are running. There are many situations that might trigger “this site can’t be reached” error in browsers. Sometimes the server is still running but the interface application is closed or the database is down. If your application interface and server is up but a dependent service is down then restart your computer/server and restart services. Make sure the app is bound to localhost. It may just be bound to an individual interface. netstat -na will give you the clues you need. Run a port scan on your computer and make sure the port is opened.
The problem may happens for failing on DNS lookup . DNS is that network address that translates the website name to its internet address. Most often it causes for not getting the internet connection or misconfigured internet or network settings. Another reason could be the firewall preventing Google Chrome to load the webpage. However, other reasons, such as insufficient permissions or the Apache web server not running properly might also cause the error.
It’s most likely a CORS issue.
I faced the same issue when running Strapi in Google Cloud Shell, Github Codespace, and Gitpod.
Try port forwarding or using Ngrok.