Astro Info
Astro v5.1.8
Node v20.12.0
System Windows (x64)
Package Manager npm
Output server
Adapter @astrojs/node
Integrations @astrojs/react
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.mjs server>host set to true.
e.g. for astro preview --host I get:
20:30:34 [@astrojs/node] Server listening on
local: http://localhost:3000
network: http://192.168.88.23:3000
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:
astro v5.1.8 ready in 332 ms
┃ Local http://localhost:3000/
┃ Network http://192.168.88.23:3000/
http://172.23.96.1:3000/
http://172.19.176.1:3000/
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 as astro 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:
// @ts-check
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';
// https://astro.build/config
export default defineConfig({
server: {
host: true,
},
output: 'server',
adapter: node({
mode: 'standalone',
}),
});
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 previewand make it available on all IP addresses.I tried
npm run astro preview --hostand I tried astro.config.mjsserver>hostset totrue.e.g. for
astro preview --hostI 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 previewwith--hostflag in the same way asastro devLink 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/nodeadapter. Sample astro configuration: