GithubHelp home page GithubHelp logo

Comments (6)

tamaracloudinary avatar tamaracloudinary commented on June 9, 2024 1

Hi @alamgir8, if you are using react (front-end) import cloudinary from "cloudinary/lib/cloudinary"; you can't configure cloudinary using node.js code cloudinary.config({ cloud_name... if you want to delete assets from the client side, please refer to the docs here: https://cloudinary.com/documentation/upload_images#deleting_client_side_uploaded_assets

Subject: Regarding Cloudinary Configuration and Client-Side Asset Deletion

Hi @alamgir8, if you are using React on the front-end, the following import statement is typically used to import the Cloudinary library:

import cloudinary from "cloudinary/lib/cloudinary";

However, it is important to note that configuring Cloudinary using Node.js code, specifically cloudinary.config({ cloud_name..., is not compatible with the front-end implementation in React.

Regarding the deletion of assets from the client side, we recommend referring to our documentation, which provides detailed instructions on the process. You can find the relevant information at the following link:https://cloudinary.com/documentation/upload_images#deleting_client_side_uploaded_assets

Thanks
-Tamara

from cloudinary_npm.

aleksandar-cloudinary avatar aleksandar-cloudinary commented on June 9, 2024

Hi @alamgir8, Thanks for reporting. Could you please share a bit more details about what isn't working once you upgraded to Node JS version 18? Do you have trouble installing the SDK or any errors during runtime etc?

from cloudinary_npm.

alamgir8 avatar alamgir8 commented on June 9, 2024

Hi @aleksandar-cloudinary I'm trying to delete an image from the client side in react app and my configuration is like this

import cloudinary from "cloudinary/lib/cloudinary";

cloudinary.config({
  cloud_name: import.meta.env.VITE_APP_CLOUD_NAME,
  api_key: import.meta.env.VITE_APP_CLOUDINARY_API_KEY,
  api_secret: import.meta.env.VITE_APP_CLOUDINARY_API_SECRET,
});

and inside the delete function calling the Cloudinary uploader to destroy/delete the image

await cloudinary.v2.uploader.destroy(public_id);

It worked properly on Node version 16 but did not work on Node version 18

And the error is this
Uncaught TypeError: Cannot read properties of undefined (reading 'node') at node_modules/cloudinary/lib/utils/index.js (index.js:69:84) at __require2 (chunk-WQG2LZMB.js?v=6276bb8f:16:50) at node_modules/cloudinary/lib/cloudinary.js (cloudinary.js:3:17) at __require2 (chunk-WQG2LZMB.js?v=6276bb8f:16:50) at cloudinary_lib_cloudinary.js?v=6276bb8f:6:16

from cloudinary_npm.

tamaracloudinary avatar tamaracloudinary commented on June 9, 2024

Hi @alamgir8 , you can try updating your Cloudinary library to the latest version. Please try running the following command in your project directory npm install cloudinary@latest or if you are using yarn, you can run: yarn add cloudinary@latest.This will update the Cloudinary library to the latest version available.

Additionally, if you are using any other dependencies or plugins alongside Cloudinary, ensure that they are also compatible with Node.js 18 and up-to-date.

Please let me know if the issue was resolved.

from cloudinary_npm.

alamgir8 avatar alamgir8 commented on June 9, 2024

Hi @tamaracloudinary i'm using Cloudinary latest version "cloudinary": "^1.37.1",. Also tried to re-install this npm install cloudinary@latest, but still had the same issue, it crashed the app.

And all other packages are compatible with Node 18, I checked that..

from cloudinary_npm.

rnamba-cloudinary avatar rnamba-cloudinary commented on June 9, 2024

Hey @alamgir8 any chance you can send us a reproducible environment for us to test in?

from cloudinary_npm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.