Remember to close localhost tabs before GatsbyJS npm start

September 08, 2021

Remember to close localhost tabs before GatsbyJS npm start featured image

Recently discovered an Issue where if the local development page is open in the browser, still attempting to connect via live-reload to the local development server, it will cause the command line process to fail or timeout.

Gatsby NPM Start errors “socket hang up” when previous localhost tab still open…

λ npm start


> gatsby develop -o
> Running Dev Command “gatsby develop --port $PORT”

> Ready! Available at http://localhost:3000
Error: socket hang up
    at connResetException (node:internal/errors:683:14)
    at Socket.socketOnEnd (node:_http_client:471:23)
    at Socket.emit (node:events:406:35)
    at Socket.emit (node:domain:470:12)
    at endReadableNT (node:internal/streams/readable:1329:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Something to do with pinging the local development server before it’s ready results in the socket hang up, So whenever I am getting the following error when trying to boot my local development server I remember to go back and close any browser tabs pointed to localhost and voilà!

headshot photo

Published on

September 08, 2021

Topic:

griffen.codes

made with 💖 and

2024 © all rights are reserved | updated 52 seconds ago

Footer Background Image