Hosting and deploy
What is localhost:5173, and why won't it load?
localhost:5173 is the default address of the Vite dev server. Why it refuses to connect, how to open it from another device, and what changes in production.
localhost:5173 is where the Vite development server runs by default on your own computer. Vite is used by React, Vue, Svelte and many AI app builders. If it will not load, start the dev server with npm run dev and check the address it prints: if 5173 is busy, Vite picks the next free port, such as 5174.
Published · Last updated
What localhost:5173 is
When you run npm run dev in a Vite project, Vite starts a development server and prints something like Local: http://localhost:5173/. localhost is your own machine, and 5173 is Vite's default port. The page you see there is the development build, with hot reloading, served only to you.
Why it will not load
- The dev server is not running. Run npm run dev in the project folder and keep the terminal open.
- Port 5173 was busy, so Vite started on 5174 or higher. Use the address it printed.
- Dependencies are missing. Run npm install first.
- The page loads but stays blank: a JavaScript error. Open the browser console.
- You are opening it from a different device or from inside a container, where localhost means something else.
Opening it on your phone or another device
By default Vite listens only on localhost. To reach it from another device on the same network, start it with:
npm run dev -- --host
Vite then prints a Network address, such as http://192.168.1.20:5173, to open on the other device. In Docker, use --host as well and publish the port.
Fixing the port
To always use a specific port, set it in vite.config:
export default { server: { port: 5173, strictPort: true } };strictPort makes Vite fail instead of silently moving to another port, which helps when other tools expect a fixed address.
What changes in production
localhost:5173 is development only. For production, npm run build creates a dist folder of static files to deploy to a host. Two things often surprise people:
- A Vite React app is rendered in the browser. The served HTML is nearly empty until JavaScript runs, which affects link previews and some crawlers.
- Client-side routes need the host to serve index.html for unknown paths, or direct visits return 404.
npm run preview serves the production build locally on port 4173. Test there before deploying, because some bugs only appear in the build.
What a scan can and cannot tell you
WebAuditOS cannot reach localhost. After you deploy, it compares the HTML your server sends with the rendered page, which shows how much of a Vite single-page app depends on JavaScript, and reports console errors and failed requests, such as API calls still pointing at localhost.
A large difference between served and rendered content is normal for a client-side app. It is worth knowing what crawlers and link previews receive before you launch.
Short answers
Why does Vite use port 5173? It is simply Vite's default.
How do I change the Vite port? Use --port or server.port in vite.config.
Why does localhost:5173 refuse to connect? The dev server is not running or moved to another port.
Can I deploy localhost:5173? No. Run npm run build and deploy the dist folder.
In the product
The checks this maps to
Every check named here runs on every scan, on every plan - what a plan changes is how many pages are crawled, how long the history is kept and what you can do with the result. These are the ids the findings carry, so you can match a line in a report to the explanation above.
- seo.js-rendered-content - Content is present in the served HTML
- tech.console-errors - No JavaScript errors in the console
- tech.failed-requests - No failed subresource requests
Read next
Hosting and deploy
What is Vite, and how does it work with React?
Vite is a fast build tool and dev server for modern web apps. How it works with React, what npm run build produces, and what it means for SEO and hosting.
Hosting and deploy
What is localhost:3000, and why won't it load?
localhost:3000 is a development server on your own computer. Which tools use port 3000, and how to fix refused connections and port in use errors.
Hosting and deploy
What is the localhost IP address?
localhost resolves to 127.0.0.1 in IPv4 and ::1 in IPv6, the loopback address of your own machine. What loopback means, 0.0.0.0, and why containers confuse it.