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

Property 'new' is a static member of type 'Cloudinary' #192

Closed
davidhan527 opened this issue Sep 28, 2019 · 4 comments
Closed

Property 'new' is a static member of type 'Cloudinary' #192

davidhan527 opened this issue Sep 28, 2019 · 4 comments
Assignees

Comments

@davidhan527
Copy link

Sorry if this is a basic question but I'm very new to typescript and I'm having trouble with getting Cloudinary to work with typescript.

Here are the relevant parts of the file.

import "cloudinary-video-player/dist/cld-video-player.min.css";
import cloudinary from "cloudinary-core";
import "cloudinary-video-player/dist/cld-video-player.min.js";

const VideoPlayer = props => {
  const cld = cloudinary.Cloudinary.new({ cloud_name: "dombgxi4e" });
}

and I get this error

TS2576: Property 'new' is a static member of type 'Cloudinary'
Failed to compile.

Any ideas how to fix this error?

@michalkcloudinay michalkcloudinay self-assigned this Sep 29, 2019
@michalkcloudinay
Copy link

Hi @davidhan527, Currently we don’t support typescript with our video player. You can embed the video player in a javascript project.

@paul-vd
Copy link

paul-vd commented Jun 16, 2020

@michalkcloudinay this seems to be a problem with the typing of import cloudinary from "cloudinary-core" and nothing with the video player, I do not understand why this issue has been closed?

image

image

So it's unclear how the core should be used in ts, or the typing is broken?

in the typescript file it gives and example

/**
 * Main Cloudinary class
 * @class Cloudinary
 * @param {Object} options - options to configure Cloudinary
 * @see Configuration for more details
 * @example
 *    var cl = new cloudinary.Cloudinary( { cloud_name: "mycloud"});
 *    var imgTag = cl.image("myPicID");
 */

but even that does not work correctly
image

all of this might be linked to this issue #189

@ghost
Copy link

ghost commented Jun 17, 2020

Hi @PaulPCIO does this solve it for you?

import {Cloudinary} from 'cloudinary-core';
const cld = new Cloudinary({cloud_name: "demo"});

@ghost ghost reopened this Jun 17, 2020
@ghost ghost mentioned this issue Jun 18, 2020
@paul-vd
Copy link

paul-vd commented Jun 19, 2020

Yea that solved it! thanks

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