Strapi Server restarts everytime I change my Astro code

System Information
  • Strapi Version: 4.16.0
  • Operating System: Fedora Linux
  • Database: sqlite
  • Node Version: 20.10.0
  • NPM Version: 10.4.0
  • Yarn Version: 1.22.21

Hello, I’m working on an Astro project where I’m trying to fetch data from a Strapi API. However, I’m encountering an issue where I’m getting an ECONNREFUSED error everytime I make a small change to my Astro code. This is kind of unbearable because I am working on the frontend of my blog and I need to make some changes every few seconds. I’ve noticed that everytime I change The error message indicates that the connection was explicitly refused by the target machine (, which is where my Strapi API server is running.

I’ve checked on the terminal and I see that everytime I make a change the Strapi server restarts. Is there a way to avoid this?

Here’s the exact error message I’m getting:

TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:11730:11)
Cause: { "errno": -111, "code": "ECONNREFUSED", "syscall": "connect", "address": "", "port": 1337 }

Thank you in advance for your assistance.