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?