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

ESM default import This expression is not callable #228

Closed
jdbruijn opened this issue Jun 5, 2023 · 3 comments · Fixed by #241
Closed

ESM default import This expression is not callable #228

jdbruijn opened this issue Jun 5, 2023 · 3 comments · Fixed by #241

Comments

@jdbruijn
Copy link

jdbruijn commented Jun 5, 2023

I ran into this issue when trying to import this as default import. I'm not too familiar with manually created types and namespaces, so I'm not entirely sure what is going on. Please see my basic reproduction repo: https://github.com/jdbruijn/axios-retry-test. I did some tests and can get the import to work by casting the type, but that should not be needed of course. This is with esModuleInterop and v3.5.0.

System info

  System:
    OS: macOS 12.6.5
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 78.21 MB / 8.00 GB
    Shell: 5.8.1 - /usr/local/bin/zsh
  Binaries:
    Node: 18.16.0 - /usr/local/opt/node@18/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.5.1 - /usr/local/opt/node@18/bin/npm

@erkannt
Copy link

erkannt commented Jun 7, 2023

Perhaps pertinent discussion: microsoft/TypeScript#52086

@folkg
Copy link

folkg commented Jun 14, 2023

I am seeing the same error on my project. I was able to work around it in the same way by using your type-casting solution.

@MLinek
Copy link

MLinek commented Jun 28, 2023

Using ts-ignore helped in my case

import axiosRetry from "axios-retry";
// @ts-ignore
axiosRetry(axios, {retries: 3, retryDelay: axiosRetry.exponentialDelay});

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