Troubleshoot - React App Connection Refused on Vpn
#react-js #software development #troubleshoot
- Using VPN
When running the React development server for
localhost development the development server starts but fails to render in the browser. i.e. “Connection Refused”
Using a VPN can cause issues with the local development of a react app.
To solve this you can either:
Disable the VPN
HOSTenvironment variable that you initialize the React development server with.
React uses the
PORT environment variables passed to the
react-scripts to initialize the Webpack server to determine on which host and port it should run. See Advanced Configuration or the inline source here.
The default settings for
HOST=127.0.0.1 npm run react-scripts start
You should now be able to access your development server on