Skip to content

Commit

Permalink
fix: enforce localhost for cli test and avoid logger error when tryin…
Browse files Browse the repository at this point in the history
…g to log network details
  • Loading branch information
dominikg committed Sep 26, 2021
1 parent 1089930 commit 6d12eae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/playground/cli/vite.config.js
@@ -1,6 +1,9 @@
const { defineConfig } = require('vite')

module.exports = defineConfig({
server: {
host: 'localhost'
},
build: {
//speed up build
minify: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/logger.ts
Expand Up @@ -153,7 +153,7 @@ export function printServerUrls(
} else {
Object.values(os.networkInterfaces())
.flatMap((nInterface) => nInterface ?? [])
.filter((detail) => detail.family === 'IPv4')
.filter((detail) => detail && detail.address && detail.family === 'IPv4')
.map((detail) => {
const type = detail.address.includes('127.0.0.1')
? 'Local: '
Expand Down

0 comments on commit 6d12eae

Please sign in to comment.