-
Notifications
You must be signed in to change notification settings - Fork 11
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
[BUG] TypeError: ImgurClient is not a constructor #214
Comments
@pkdev08 you need to deconstruct the ImgurClient type, as shown in the documentation: // ESModule syntax
import { ImgurClient } from 'imgur'; |
Hi, when I do that it's having export issues. import { ImgurClient } from 'imgur'; import pkg from 'imgur'; |
@pkdev08 can you try the following lines:
I started running into this error in another project and I have now realized that esm imports do not work as intended, which was the primary target for this library. I will try to find a way to resolve this in the export, maybe by moving to rollup, as soon as I am able to. |
I just realized that this was also pointed out in a previous issue, so I am closing this ticket as it is a duplicate of the issue in #205. |
import ImgurClient from 'imgur';
const client = new ImgurClient({
clientId: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET
});
Gives error TypeError: ImgurClient is not a constructor
On LTS node 18.12.1 using ESM
The text was updated successfully, but these errors were encountered: