Skip to content

Commit

Permalink
fix: check node version and find acceptable host accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
arimgibson committed Jun 15, 2022
1 parent 31e3224 commit 27e70a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/kind-feet-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix: find a hosting network differently based on Node version
4 changes: 3 additions & 1 deletion packages/astro/src/core/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ export function devStart({
const ipv4Networks = Object.values(os.networkInterfaces())
.flatMap((networkInterface) => networkInterface ?? [])
.filter(
(networkInterface) => networkInterface?.address && networkInterface?.family === 'IPv4'
(networkInterface) =>
networkInterface?.address &&
networkInterface?.family === (Number(process.version.substring(1, 5)) < 18.1 ? 'IPv4' : 4)
);
for (let { address } of ipv4Networks) {
if (address.includes('127.0.0.1')) {
Expand Down

0 comments on commit 27e70a3

Please sign in to comment.