Next.js Discord

Discord Forum

Error while building the page.

Answered
kubas posted this in #help-forum
Open in Discord
Hi! I got an error while building the page:
TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11118:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  cause: Error: connect ECONNREFUSED 192.168.0.27:3000
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)
      at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
    errno: -4078,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '192.168.0.27',
    port: 3000
  }
}

Error occurred prerendering page "/blog". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11118:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

This is my code: https://gist.github.com/KubaZary1/9cfc3ca513fa8cdf1b25bee24f5c3dfa
Additional information:
- process.env.URL === http://192.168.0.27:3000
- I use .env, not .env.local, i prefer not to change it
- api is working fine
Answered by kubas
i just made it client component
View full answer

1 Reply

i just made it client component
Answer