ESlint complains that v2 doesn't exist
Bug report for Cloudinary NPM SDK
Before proceeding, please update to latest version and test if the issue persists
Describe the bug in a sentence or two.
Issue Type (Can be multiple)
[ ] Build - Can’t install or import the SDK [ ] Babel - Babel errors or cross browser issues [ ] Performance - Performance issues [ ] Behaviour - Functions aren’t working as expected (Such as generate URL) [ ] Documentation - Inconsistency between the docs and behaviour [x] Incorrect Types - For typescript users who are having problems with our d.ts files [ ] Other (Specify)
Steps to reproduce
Enable the import/named rule of ESLint.
https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/named.md
Error screenshots
… if applicable
Browsers (if issue relates to UI, else ignore)
[ ] Chrome [ ] Firefox [ ] Safari [ ] Other (Specify) [ ] All
Versions and Libraries (fill in the version numbers)
Cloudinary_NPM SDK version 2.4.0 Node - 18.9.0 NPM - 10.2.3
Config Files (Please paste the following files if possible)
Package.json
Repository
If possible, please provide a link to a reproducible repository that showcases the problem
Hi there,
Can you try initializing Cloudinary with the following:
const cloudinary = require('cloudinary').v2;
@PixelCook I could but the whole point is to not use CommonJS and rather switch to ES6 modules. We are using TypeScript so we are able to do so.
The library could probably export an ES6 modules alongside the CommonJS interface.
Thank you!
@kostas-pblworks have you tried the following?
import {v2 as cloudinary} from 'cloudinary'
@PixelCook
Hi @kostas-pblworks. In order to speed up diagnosis, could you please create a simple repo which shows this issue so that we can debug this further?