softonic / axios-retry

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

[TypeScript]Unable to import names #251

Closed yutak23 closed 1 year ago

yutak23 commented 1 year ago

We cannot use name import.

srv/app.ts:2:22 - error TS2614: Module '"axios-retry"' has no exported member 'IAxiosRetryConfig'. Did you mean to use 'import IAxiosRetryConfig from "axios-retry"' instead?

2 import axiosRetry, { IAxiosRetryConfig } from 'axios-retry';
                       ~~~~~~~~~~~~~~~~~

I noticed this when @rchl pointed it out to me. My apologies. https://github.com/softonic/axios-retry/pull/250#issuecomment-1810403564

borisilic-ap commented 1 year ago

Similar issue here where exponentialDelay can no longer be de-structured like so

// TS2614: Module  'axios-retry'  has no exported member  exponentialDelay. 
import axiosRetry, { exponentialDelay } from 'axios-retry'

This happens with the change from 3.8.2 to 3.9.0.

This is a breaking change, the version should be bumped to 4.0.0.

mindhells commented 1 year ago

closed as #250 has been reverted on 3.9.0 The plan is now to migrate to TS implementation Thanks for your feedback!