Use Jimp in a React application

138 Views Asked by At

I have a basic React app. I'm trying to use jimp library to manipulate images.
However I'm getting Uncaught TypeError: Class extends value [object Object] is not a constructor or null.
I read that jimp can only be used on a NodeJS server but I've come accros examples of using jimp in React applications.

Here's my code

useEffect(() => {
  const getImage = async () => {
    try {
      const image = await Jimp.read("...");

      image.pixelate(20);

      console.log("Image processed successfully");
    } catch (err) {
      console.error("Error processing image:", err);
    }
  };

  getImage();
}, []);
0

There are 0 best solutions below