Next.js Discord

Discord Forum

View dev app on local network?

Answered
Lord_TCG#9068 posted this in #help-forum
Open in Discord
It was my understanding http://<ipAddress>:<portNumber> would allow any device on the same home wifi network to view my app? However doing so just returns a timeout error page for my desktop and mobile devices.

Do I need to do any additional config/setup to get this to work? I've done it in the past but it's been years so maybe I forgot a step? I was hoping to get my desktop via localhost and my mobile via http://<ipAddress>:<portNumber> to view the app together so I can design for both setups in real time, rather than do one later after completing the other.

Any help would be great 🙂
Answered by Toyger
your firewall, or maybe custom antivirus software can block connection, and are you using ip of local network not external?
View full answer

10 Replies

For context, I just have the default vercel template code after running npx create-next-app@latest
Cape horse mackerel
I've just tried and it works fine
npm run build && npm run start
http://my-ip:3000 and can view it on the mobile
So you have to use the build version not the dev version?
Toyger
your firewall, or maybe custom antivirus software can block connection, and are you using ip of local network not external?
Answer
likely a 192 ip
192.168.0.0 ect
Cape horse mackerel
well next start will use production environment variables by default
you can set smth like
"start:dev": "NODE_ENV=development next start"
Aaah yeah it was a firewall issue. I must have changed AV since I got this working last. New rule fixes the issue
Appreciate your time peeps ❤️