Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(0 , async_retry_1.retry) is not a function #103

Open
akramrabiie opened this issue Mar 9, 2023 · 3 comments
Open

(0 , async_retry_1.retry) is not a function #103

akramrabiie opened this issue Mar 9, 2023 · 3 comments

Comments

@akramrabiie
Copy link

Hello
I am getting this error while using retry

(0 , async_retry_1.retry) is not a function

Here is my code:

 await retry(
        async () => {
          await this.myMethod(arguments)
        },
        { retries: 2 },
      );

Could you please help?

@akramrabiie
Copy link
Author

akramrabiie commented Mar 9, 2023

Well, I changed the import statement and it worked by require
const retry = require('async-retry');

But based on your example it should've been worked with the import 🤔

@pedropaiva1
Copy link

I did have the same error using with typescript, but when i changed the syntax to 'import * as retry from 'async-retry'' it works, i dont know how

@vitaly-t
Copy link

If you still stuck, check out this complete solution in TypeScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants