Did you mean to visit localhost:5173?

Did you mean to visit: http://localhost:5173/?

About Port 5173

Port 5173 is commonly used by:

Common Issues with Port 5173

"Port 5173 is already in use"

This error occurs when another application is already using port 5173. Solutions:

  • Find and close the application using port 5173
  • Use a different port:
    • Command line: npm run dev -- --port 5174
    • In vite.config.js:
      export default defineConfig({
        server: {
          port: 5174
        }
      })
  • On Windows, find and kill the process: netstat -ano | findstr :5173 then taskkill /PID [PID] /F
  • On Linux/Mac: lsof -i :5173 then kill -9 [PID]

"Hot Module Replacement (HMR) not working"

If changes aren't automatically reflecting in the browser:

  • Check if your Vite server is running with HMR enabled
  • Ensure you haven't disabled HMR in your vite.config.js
  • Check for errors in the browser console
  • Try restarting the development server
  • Make sure your file is being processed by Vite (check import paths)

"Cannot access localhost:5173 from other devices"

By default, Vite's development server only listens on localhost:

  • To make it accessible from other devices: npm run dev -- --host
  • Or in vite.config.js:
    export default defineConfig({
      server: {
        host: '0.0.0.0'
      }
    })
  • Then access it using your computer's IP address: http://YOUR_IP:5173

Useful Resources