VibeDict

🌐Connection refused (localhost refused to connect)

What you'll see
localhost refused to connect. ERR_CONNECTION_REFUSED

No server is waiting at that address. Most of the time, the dev server isn't running or has stopped.

🤔 Why does it happen?

  • The dev server (npm run dev) wasn't started, or it stopped because of an error
  • The port number is different (it may have started on 3001 instead of 3000)
  • You closed the terminal window, and the server stopped with it

🔧 Try this

  1. Run npm run dev again in the terminal
  2. Open the exact address shown in the terminal (for example, http://localhost:3001)
  3. If the server stops right after starting, read the red error message in the terminal

🤖 Ask your AI like this

When I go to localhost, I get 'refused to connect' (ERR_CONNECTION_REFUSED). Please walk me through how to start the dev server step by step, and if the server won't start, look at the terminal output below and find the cause. [Paste the terminal output here]

Replace the [ ] parts with your own situation, and paste the error with a few extra lines before and after it.

Related terms

Other errors in this group