Next.js Discord

Discord Forum

TypeError: fetch failed

Unanswered
neon posted this in #help-forum
Open in Discord
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

Spectacled bear
Seems you are trying to connect to other server which is blocked or not accessible
@Barbary Lion ou should give the relevant code because I have 0 idea what you are trying to do
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)
it's just a static client-side portfolio site, with some threejs stuff
Spectacled bear
Wel I thought you were going to do the connection thing
@neon it's just a static client-side portfolio site, with some threejs stuff
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
@Barbary Lion is this error affecting your site at all?
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
@neon I mean, the site shows a 500 Internal Server Error page
Barbary Lion
are there any fetches in your code?
Nope
if you want you can look at the code here: https://github.com/goodboyneon/goodboyneon.github.io
Barbary Lion
does this error happen locally
Barbary Lion
delete node modules and do npm install again
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.
Barbary Lion
try wiht npm wont hurt
@Excigma try downgrading to 13.4.12
Just wondering, is this fixed in the new release?
@neon Just wondering, is this fixed in the new release?
I haven't tried, some people found success upgrading to canary...
there is a GitHub issue where at least one person says it persists...
I have upgraded, let's see how things go
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?
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
memory usage is very high though, my issue might be memory related..
next dev server uses 3gb+ ram
high memory usage is common to everyone and to every version, we have to live with it here
yeah
cries in 8gb
lol i have 16 GB RAM and still feel it's not enough
@Excigma next dev server uses 3gb+ ram
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
yeah my integrated graphics dies and everything goes black every once in a while