Adds retry functionality to any fetch library (isomorphic-fetch, cross-fetch, unfetch, or Node.js native fetch). v6.0.0 wraps an existing fetch implementation and retries failed requests due to network errors or specific HTTP status codes. Defaults to 3 retries with 1000ms delay. Supports exponential backoff via custom retryDelay function. Ships TypeScript types. Lightweight with no additional dependencies beyond a fetch polyfill. Compatible with browser and Node.js (>=18).
npm install fetch-retryNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows wrapping cross-fetch with fetch-retry, custom exponential backoff delay, and retrying on 503 status codes.
Use fetchRetry(originalFetch) instead of require('fetch-retry')(originalFetch) which is now required.Upgrade to Node.js >= 12 or use an older version of fetch-retry (but note security risks).
Ensure the request body is not a stream or clone it before retrying. Alternatively, use a custom retry function to recreate the request.
Use cross-fetch or node-fetch instead, or ensure you wrap the correct fetch instance.
Update code to call fetchRetry(fetch) instead of using fetchRetry directly.
Use default import: import fetchRetry from 'fetch-retry'; or require: const fetchRetry = require('fetch-retry');Run 'npm install fetch-retry'. Ensure import path is 'fetch-retry' without any subpath.
Ensure you pass a fetch implementation like cross-fetch, node-fetch, or global.fetch.
Check network connectivity. Ensure the fetch polyfill supports the environment (e.g., browser vs Node).
No dependency data recorded yet.