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

ESlint complains that v2 doesn't exist #682

Closed
kostas-pblworks opened this issue Aug 26, 2024 · 5 comments
Closed

ESlint complains that v2 doesn't exist #682

kostas-pblworks opened this issue Aug 26, 2024 · 5 comments

Comments

@kostas-pblworks
Copy link

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.

image

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

@cloudinary cloudinary deleted a comment Aug 26, 2024
@cloudinary cloudinary deleted a comment Aug 26, 2024
@PixelCook
Copy link

Hi there,

Can you try initializing Cloudinary with the following:

const cloudinary = require('cloudinary').v2;

@kostas-pblworks
Copy link
Author

@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!

@PixelCook
Copy link

@kostas-pblworks have you tried the following?

import {v2 as cloudinary} from 'cloudinary'

@kostas-pblworks
Copy link
Author

@PixelCook
image

@dannyv-cloudinary
Copy link
Contributor

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?

@dannyv-cloudinary dannyv-cloudinary closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2024
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