MOHAMMAD-NAYAN / nayan-media-downloader

15 stars 7 forks source link

Issue while using it in react native #21

Open StDensity opened 2 weeks ago

StDensity commented 2 weeks ago
ReferenceError: Property 'alldown' doesn't exist, js engine: hermes
 ERROR  ReferenceError: Property 'alldown' doesn't exist, js engine: hermes
 ERROR  SyntaxError: 1:6578:async functions are unsupported, js engine: hermes
 ERROR  TypeError: Down.alldown is not a function (it is undefined), js engine: hermes

code:

// Import the required function from the package
import * as Down from 'nayan-media-downloader'

export const downloadMediaFromTwitter = (
   url = "https://x.com/FAFO_TV/status/1853548178114486357"
) => {
   return Down.alldown(url)
      .then((data) => {
         console.log("Download successful:", data);
         return data;
      })
      .catch((error) => {
         console.error("Error downloading media:", error);
         throw error; 
      });
};

downloadMediaFromTwitter();
MOHAMMAD-NAYAN commented 2 weeks ago
Try this Code

code:

// Import the required function from the package
import nayan from "nayan-media-downloader";

export const downloadMediaFromTwitter = async (
   url = "https://x.com/FAFO_TV/status/1853548178114486357"
) => {
   try {
      const data = await nayan.alldown(url);
      console.log("Download successful:", data);
      return data;
   } catch (error) {
      console.error("Error downloading media:", error);
      throw error;
   }
};

// Call the function
downloadMediaFromTwitter();

Screenshot_20241105_184145_Chrome

StDensity commented 2 weeks ago

It isn't working ERROR SyntaxError: 1:6578:async functions are unsupported, js engine: hermes [Component Stack]

I works when i try it with node. But not when using react native expo

MOHAMMAD-NAYAN commented 2 weeks ago

Contact wp: wa.me/+8801615298449

StDensity commented 2 weeks ago

Is telegram good?