Skip to content

Fix: Replace hardcoded localhost with 127.0.0.1 to resolve IPv6 connection#35

Open
smrithipiedy wants to merge 1 commit into
Ashmita1206:mainfrom
smrithipiedy:fix-localhost-resolution
Open

Fix: Replace hardcoded localhost with 127.0.0.1 to resolve IPv6 connection#35
smrithipiedy wants to merge 1 commit into
Ashmita1206:mainfrom
smrithipiedy:fix-localhost-resolution

Conversation

@smrithipiedy

Copy link
Copy Markdown

Purpose of this PR:

Replaces hardcoded localhost references with explicit 127.0.0.1 IPv4 loopback addresses in database connection strings and CORS proxy configurations.
Fixes #34

Reason for this fix:

In Node.js v17 and later, DNS resolution for localhost defaults to the IPv6 address (::1) first. Because the local MongoDB server binds to the IPv4 interface, this causes Mongoose to hang indefinitely on startup, which subsequently causes Vite proxy timeouts (HTTP 500 errors) for new developers setting up the project.

By explicitly declaring 127.0.0.1, the server starts instantly and bypasses the IPv6 resolution bug, greatly improving the Developer Experience (DX) for anyone cloning this repo.

@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

@smrithipiedy is attempting to deploy a commit to the anglenobida003-8112's projects Team on Vercel.

A member of the Team first needs to authorize it.

@smrithipiedy

Copy link
Copy Markdown
Author

Hi @Ashmita1206, this PR is good to go! Please do check this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix IPv6 localhost DNS resolution hang in Node v17+

1 participant