After following the shopify create an app documentation, whenever i run ‘npm run dev’ i keep getting ‘Error forwarding web request: Error: connect ECONNREFUSED 127.0.0.1:40021’ when i try to open the installed app in my store.
Topic summary
A user encounters an “Error forwarding web request” with “ECONNREFUSED 127.0.0.1:40021” when running npm run dev after following Shopify’s app creation documentation. The error appears when attempting to open the installed app in their store.
Suggested troubleshooting steps:
- Verify the development server is running and listening on the correct port (40021)
- Check firewall settings that might be blocking the connection
- Try using a different port, as 40021 may already be in use by another service
- Verify network connectivity
- Reinstall dependencies by deleting
node_modulesandpackage-lock.json, then runningnpm install
The issue remains unresolved, with the responder requesting more information about the setup if these steps don’t work.
Hi CipherB,
This Error forwarding web request error usually happens when the development server isn’t running or isn’t accessible. Here are a few things you can try to fix the issue:
-
Check if your development server is running: The error message implies that nothing is listening on port 40021. Make sure that your development server is running and is set to listen on the correct port.
-
Check your firewall settings: Your firewall might be blocking the connection to the server. You can try to temporarily disable your firewall and see if the error persists.
-
Try a different port: The port you’re using might be already in use by another service. Try changing the port for your development server.
-
Check your network connection: Make sure that your computer is correctly connected to the network.
-
Reinstall dependencies: There might be an issue with your project’s dependencies. Try deleting your
node_modulesdirectory and yourpackage-lock.jsonfile, and then runnpm installagain.
If none of these steps solve the issue, please provide more information about your setup, and we can dive into this issue further. Hope this helps!