Whenever I try to run a dev server (be it Vite, or a NextJS application, or live-server) in LAN (192.168.1.7:3000 like so), I always get this error.
Screenshot of error as shown in the browser
I am working on Windows and I have run dev servers in LAN before in my PC. But something has changed but I have no clue about it. Has anyone else faced this issue?
I tried the answers given in running a Development server on NextJS (on the network) for a next js application that I'm building at the moment, but still no luck. Result from trying to run the server manually:
npx next dev -- -H 192.168.1.7:3000
- error Failed to start server
Error: getaddrinfo ENOTFOUND 192.168.1.7:3000
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: '192.168.1.7:3000'
Running manually on specific port as suggested in this answer.
npx next dev -- -H 192.168.1.7 -p 3000
- ready started server on 192.168.1.7:3000, url: http://192.168.1.7:3000
- event compiled client and server successfully in 219 ms (20 modules)
- wait compiling...
- event compiled client and server successfully in 168 ms (20 modules)
Error in the browser still prevailed.
Update
I found out that this issue arises only in Edge. The site is working completely fine in Chrome. What could be the reason for this?