-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Astro runs on :3000
port even though another app is running on the same port
#4315
Comments
Astro's dev server uses Vite. Does this happen on a Vite app too? Also, is your React app running on http://172.0.0.1:3000 or http://[::1]:3000. The port detection depends on which hostname your React app is running vs Vite's |
I can't reproduce. When I have something running on |
@yxshv can you go into your node_modules folder and add some logging to this file? I'm curious if astro/packages/astro/src/core/preview/index.ts Lines 135 to 148 in 485742d
|
@FredKSchott Nope it does not. httpServer == null ? void 0 : httpServer.on("error", onError);
};
const onError = (err) => {
console.log(err) // +++++++++++
if (err.code && err.code === "EADDRINUSE") {
if (!showedPortTakenMsg) {
console.log("port taken") // +++++++++++
info(logging, "astro", msg.portInUse({ port }));
showedPortTakenMsg = true;
}
port++;
return listen(); listen();
});
}
console.log("starting server"); // +++++++++
await startServer(startServerTime);
function closed() {
return new Promise((resolve, reject) => {
httpServer.addListener("close", resolve);
httpServer.addListener("error", reject);
});
} |
I don't think we support reading from Is this issue related to |
oh. It does not work on both I am starting the other react ( |
What version of
astro
are you using?1.0.1
Are you using an SSR adapter? If so, which one?
no
What package manager are you using?
pnpm
What operating system are you using?
Windows
Describe the Bug
I had a React app running on port
3000
and ran an astro app thinking that it will automatically use a different port. Bu, it didn'tLink to Minimal Reproducible Example
just run an different app on localhot:3000 and then run an astro app
Participation
The text was updated successfully, but these errors were encountered: