Skip to content

Commit 8373d2a

Browse files
committed
🤖 fix: allow all hosts when MUX_VITE_HOST is set
Change-Id: I56799a2af274a218b05a4e99d10ba7386fc451ce Signed-off-by: Thomas Kosiewski <[email protected]>
1 parent 096ec60 commit 8373d2a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ export default defineConfig(({ mode }) => ({
8989
host: devServerHost, // Configurable via MUX_VITE_HOST (defaults to 127.0.0.1 for security)
9090
port: devServerPort,
9191
strictPort: true,
92-
allowedHosts: ["localhost", "127.0.0.1"],
92+
// If MUX_VITE_HOST is set (e.g. to 0.0.0.0 for remote dev), we must allow all hosts
93+
// otherwise Vite blocks the request
94+
allowedHosts: process.env.MUX_VITE_HOST ? true : ["localhost", "127.0.0.1"],
9395
sourcemapIgnoreList: () => false, // Show all sources in DevTools
9496

9597
watch: {

0 commit comments

Comments
 (0)