diff --git a/packages/gatsby-source-contentful/package.json b/packages/gatsby-source-contentful/package.json index f69cc8fb5c98d..71ca3fe4d176e 100644 --- a/packages/gatsby-source-contentful/package.json +++ b/packages/gatsby-source-contentful/package.json @@ -11,6 +11,7 @@ "@contentful/rich-text-react-renderer": "^14.1.2", "@contentful/rich-text-types": "^14.1.2", "@hapi/joi": "^15.1.1", + "@vercel/fetch-retry": "^5.0.3", "axios": "^0.21.1", "chalk": "^4.1.0", "common-tags": "^1.8.0", diff --git a/packages/gatsby-source-contentful/src/gatsby-node.js b/packages/gatsby-source-contentful/src/gatsby-node.js index 6a173d2a57952..1fbc0c8b0a4e0 100644 --- a/packages/gatsby-source-contentful/src/gatsby-node.js +++ b/packages/gatsby-source-contentful/src/gatsby-node.js @@ -4,7 +4,7 @@ const _ = require(`lodash`) const fs = require(`fs-extra`) const { createClient } = require(`contentful`) const v8 = require(`v8`) -const fetch = require(`node-fetch`) +const fetch = require(`@vercel/fetch-retry`)(require(`node-fetch`)) const { CODES } = require(`./report`) const normalize = require(`./normalize`) diff --git a/yarn.lock b/yarn.lock index 0dec2ba28551c..6882ed52e7861 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4968,6 +4968,14 @@ "@graphql-typed-document-node/core" "^3.1.0" wonka "^4.0.14" +"@vercel/fetch-retry@^5.0.3": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@vercel/fetch-retry/-/fetch-retry-5.0.3.tgz#cce5d23f6e64f6f525c24e2ac7c78f65d6c5b1f4" + integrity sha512-DIIoBY92r+sQ6iHSf5WjKiYvkdsDIMPWKYATlE0KcUAj2RV6SZK9UWpUzBRKsofXqedOqpVjrI0IE6AWL7JRtg== + dependencies: + async-retry "^1.3.1" + debug "^3.1.0" + "@verdaccio/commons-api@9.7.1", "@verdaccio/commons-api@^9.7.1": version "9.7.1" resolved "https://registry.yarnpkg.com/@verdaccio/commons-api/-/commons-api-9.7.1.tgz#816f08eb6cb0dbe345f2546428c837be6804796d"