-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
🐛 BUG: astro preview
stopped working
#2981
Comments
|
I'm also experiencing this bug (also on a mac). What appears to be happening is that the |
astro/packages/astro/src/cli/index.ts Lines 139 to 145 in 50bd14a
I've noticed that the preview function above is immediately resolving (on my setup) and thus not staying open. I wasn't able to see any recent changes that explain why this behaviour has changed.
A naive solution seems to be changing the code to resemble the case "preview": {
try {
await preview(config, { logging });
return await new Promise(() => {
});
} catch (err) {
return throwAndExit(err);
}
} Hopefully this helps to track down the root cause. |
Running 🚀 astro v1.0.0-beta.2 started in 2ms
┃ Local http://localhost:3000/
┃ Network use --host to expose |
The same error happens on Windows 10 for me. Preview starts and outputs the URL, but then it exits immediately. |
* fix(#2981): keeps server alive * chore: adding changeset * keep alive until the 'close' or 'error' event fires
Thanks for all the debugging and details in this issue! Just merged #3004 with a fix |
* fix(withastro#2981): keeps server alive * chore: adding changeset * keep alive until the 'close' or 'error' event fires
What version of
astro
are you using?0.26.1
What package manager are you using?
npm
What operating system are you using?
Mac
Describe the Bug
npm run preview
starts without error but showsERR_CONNECTION_REFUSED
if you try to openhttp://localhost:3000/
in the browser.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-uy2pjg?file=package.json
Participation
The text was updated successfully, but these errors were encountered: