The server hangs indefinitely while the Svelte app listens

523 views Asked by At

I am new to Svelte and I am already in love with its magic. However, I am facing an issue which looks generic to me but I couldn’t find a documented solution to it.

I used the rollup template using npx degit and it was working perfectly fine earlier but now, when I run npm run dev, the app listens on the port but the server hangs indefinitely. The auto reload stops functions and keeps loading for all eternity. I tried running a brand new template repository to check if there was something wrong with my code but the new repo didn’t run either.

I am 100% positive that I am running only one app at a time. Worth noting is that I also get a loading message that says “Awaiting an available socket” I tried flushing out all the sockets and no help.

I’d really appreciate and respect it if you guys could help me out here.

Peace

Update: I usednpx degit "sveltejs/sapper-template#rollup" my-app to generate a brand new app. It threw the same error post a reload and I had not made any changes to it which, in all likelihood indicates that the problem's in my local machine.

1

There are 1 answers

0
Krish Skywalker On

I fixed my problem (thanks to the Svelte Discord Community). Turns out that your static folder cannot be too heavy (i.e. >= ~25MB), it causes the service-worker.js to crash. The ideal option is to use a CDN or disable the service-worker if you don't need the caching benefits.