0

I have a nextjs application that uses getStaticPaths and getStaticProps to prerender a bunch of different pages at build time ~250 pages.

I often do a next build && next export (actually CI does it but for simplicity sake lets pretend like I do it) and then eventually move the production assets to an S3 bucket.

Recently I've noticed pre-rendering issues popping up more frequently when executing next build and I'm not sure what could be the problem. This doesn't happen all the time, but frequently enough to cause concern.

The error I receive is this:

Error occurred prerendering page "/example/a". Read more: https://nextjs.org/docs/messages/prerender-error
2022-03-17 10:23:45.116  FetchError: request to https://my-endpoint failed, reason: read ECONNRESET

Some additional notes:

  • The api i'm hitting is an external api that is up and running. I can hit this myself and works just fine.
  • Node-fetch is being used under the hood to make these api requests, curious if anyone has had similar problems with it?
Connor.Littleton
  • 147
  • 1
  • 1
  • 12
  • Have you tried consoling out the request params that `node-fetch` is creating and hitting it via postman to understand `ECONNRESET` ?, e.g: console out the `node-fetch` request params - see here https://stackoverflow.com/questions/66724333/is-there-a-way-to-log-the-node-fetch-request – Ramakay Mar 17 '22 at 19:55

0 Answers0