A lot of the errors found on the Vercel build runs are related to the way the fetch library is used on the static build steps, especially when contacting Letterhead and Hasura. The usage generates many simultaneous connections with short timeouts and is prone to dropped connection errors. Also, the code that fetches letterhead ads has limited error handling and generates a lot of bad logs.
What
This fix creates a new http module with a fetchWithRetry function that allows more stable handling of simultaneous connections and adds error checking to the code that fetches Letterhead ads.
Why
A lot of the errors found on the Vercel build runs are related to the way the
fetch
library is used on the static build steps, especially when contacting Letterhead and Hasura. The usage generates many simultaneous connections with short timeouts and is prone to dropped connection errors. Also, the code that fetches letterhead ads has limited error handling and generates a lot of bad logs.What
This fix creates a new
http
module with afetchWithRetry
function that allows more stable handling of simultaneous connections and adds error checking to the code that fetches Letterhead ads.