cloudinary / cloudinary_npm

Cloudinary NPM for node.js integration
625 stars 317 forks source link

TypeScript error: `Property 'end' does not exist on type 'UploadStream'.` #663

Closed jlengstorf closed 3 months ago

jlengstorf commented 3 months ago

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.

The UploadStream type doesn't appear to have the .end() method defined, so valid code is throwing TS errors.

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

… if applicable

        cloudinary.uploader
            .upload_stream(
                {
                    folder: 'cloudinary-images',
                    overwrite: true,
                    detection: 'captioning',
                },
                (error, result) => {
                    if (error) return reject(error);
                    resolve(result);
                },
            )
            .end(buffer); // <== TS error here

Error screenshots

… if applicable

Screenshot 2024-06-01 at 23 02 05

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 Node - 0.0.0 NPM - 0.0.0

Config Files (Please paste the following files if possible)

Package.json

Using cloudinary@^2.2.0

Repository

If possible, please provide a link to a reproducible repository that showcases the problem

jlengstorf commented 3 months ago

I just reloaded my VS Code environment and this is no longer happening, so it must have been an issue with my IDE being out of sync. Closing.