softonic / axios-retry

Axios plugin that intercepts failed requests and retries them whenever possible
Other
1.9k stars 167 forks source link

Requiring cjs is broken since the last version (4.0.0) #257

Closed hilsenrat closed 12 months ago

hilsenrat commented 12 months ago

Hello,

I'm not sure if this was intended, but if you try to use axios-retry after you require in cjs, which worked until the last version (const axiosRetry = require('axios-retry');), an error will be thrown:

uncaughtException: axiosRetry is not a function

To fix this, you need to explicitly require default: const axiosRetry = require('axios-retry').default;

I assume that either this should be fixed in the code or at least in the documentation + release notes. Thanks!