-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 preview --host doesn't work as expected #13034
Comments
Hi, I am experiencing the same issue with Astro V5. If you are in a pinch and need to preview your build locally, running entry.mjs worked for me: $ HOST=0.0.0.0 PORT=3000 node ./dist/server/entry.mjs |
I can't reproduce this. I downloaded your Stackblitz reproduction (it won't work in Stackblitz because it's not real networking) and ran it locally, unchanged and this was the result: That shows both of my network connections, and is the same as when running dev. Can you confirm that the Stackblitz reproduction give that result for you locally too? If so maybe it's Windows, as I'm on a Mac |
I appreciate your suggestion of this option. |
I have updated StackBlitz. The one thing that differs from local reproduction was missed: The big problem is that even The |
OK, thanks. I have a fix. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
Any browser
Describe the Bug
I want to run
astro preview
and make it available on all IP addresses.I tried
npm run astro preview --host
and I tried astro.config.mjsserver>host
set totrue
.e.g. for
astro preview --host
I get:And if I try to open http://192.168.88.23:3000 in browser, I get nothing.
But if I run
astro dev --host
, I have different results:And any IP address is available from the browser.
What's the expected result?
Ability to use
astro preview
with--host
flag in the same way asastro dev
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-rnmmfmc9?file=package.json,astro.config.mjs&on=stackblitz
Participation
Added details
The issue is only reproducible with
astrojs/node
adapter. Sample astro configuration:The text was updated successfully, but these errors were encountered: