Next.js Discord

Discord Forum

TypeError: fetch failed

Unanswered
neon 🎃 posted this in #help-forum
Open in Discord
Avatar
neon 🎃OP
TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11600:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async invokeRequest (/home/neon/dev/portfolio/node_modules/next/dist/server/lib/server-ipc/invoke-request.js:17:12)
    at async invokeRender (/home/neon/dev/portfolio/node_modules/next/dist/server/lib/router-server.js:254:29)
    at async handleRequest (/home/neon/dev/portfolio/node_modules/next/dist/server/lib/router-server.js:447:24)
    at async requestHandler (/home/neon/dev/portfolio/node_modules/next/dist/server/lib/router-server.js:464:13)
    at async Server.<anonymous> (/home/neon/dev/portfolio/node_modules/next/dist/server/lib/start-server.js:117:13) {
  cause: Error: connect ECONNREFUSED ::1:42933
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '::1',
    port: 42933
  }
}

I get this error randomly while wokring on my project

41 Replies

Avatar
Spectacled bear
Seems you are trying to connect to other server which is blocked or not accessible
Avatar
Barbary Lion
ou should give the relevant code because I have 0 idea what you are trying to do
Avatar
neon 🎃OP
The thing is, I don't know what part of the code is causing it. The error just randomly appears when i refresh the page (not always)
I am not really connecting to any server
it's just a static client-side portfolio site, with some threejs stuff
Avatar
Spectacled bear
Wel I thought you were going to do the connection thing
Avatar
Barbary Lion
is this error affecting your site at all?
at least show a screen share, an error message is not enough to help you
Avatar
neon 🎃OP
I mean, the site shows a 500 Internal Server Error page
and i have to restart
It's also pretty hard to reproduce, as it randomly appears sometimes when I reload the website
Avatar
Barbary Lion
are there any fetches in your code?
Avatar
neon 🎃OP
Nope
if you want you can look at the code here: https://github.com/goodboyneon/goodboyneon.github.io
Avatar
Barbary Lion
does this error happen locally
Avatar
neon 🎃OP
yes
Avatar
Barbary Lion
delete node modules and do npm install again
Avatar
neon 🎃OP
sure
btw im using yarn, is that somehow might be an issue
also, I say let's leave this thread open for a while, as I can't confirm right away if the issue is fixed or not.
Avatar
Barbary Lion
try wiht npm wont hurt
Avatar
neon 🎃OP
Just wondering, is this fixed in the new release?
Avatar
Excigma
I haven't tried, some people found success upgrading to canary...
there is a GitHub issue where at least one person says it persists...
Avatar
neon 🎃OP
I have upgraded, let's see how things go
Avatar
Excigma
fingers crossed... I think someone mentioned running out of memory and a worker thread crashing
and the requests get sent to a crashed worker so econnrefused?
Avatar
joulev
yes either 13.5.1 or 13.4.12 should work
try 13.5.1 first
if it doesn't work then go to 13.4.12 where it will definitely work
Avatar
Excigma
memory usage is very high though, my issue might be memory related..
next dev server uses 3gb+ ram
Avatar
joulev
high memory usage is common to everyone and to every version, we have to live with it here
Avatar
Excigma
yeah
cries in 8gb
Avatar
joulev
lol i have 16 GB RAM and still feel it's not enough
Avatar
neon 🎃OP
I can definitely agree, with just 6 gigs of ram, I constantly have to worry about the memory usage reaching 100% and crashing my system
Avatar
Excigma
yeah my integrated graphics dies and everything goes black every once in a while