0

I can't seem to figure out what the problem is. I'm trying to use EvaporateJS to upload files to S3, I'm also using React. Here is what my code looks like:

Blockquote

useEffect(() => {

    Evaporate.create({
        aws_key: AWS_ACCESS_KEY,
        bucket: S3_BUCKET,
        awsRegion: 'us-west-1', // s3 region
        signerUrl: '/api/videos/signv4_auth',
        awsSignatureVersion: '4',
        computeContentMd5: true,
        cloudfront: true,
        cryptoMd5Method: (data) => {
            return AWS.util.crypto.md5(data, 'base64');
        },
        cryptoHexEncodedHash256: (data) => {
            return AWS.util.crypto.sha256(data, 'hex');
        }
    }).then(evaporate => {
        console.log(evaporate);
        // evaporate.add(); // showing as not a function
    });

}, []);

But I get an error message: evaporate.add is not a function. When I inspect the evaporate variable that's being passed with then, it doesn't contain the add function, nor some of the other functions mentioned in documentation. Not sure why it's not working, any help would be highly appreciated.

Console output of evaporate

Error Message

George
  • 1
  • I think those methods are inside `__proto__`. It could be the case `evaporate` is getting shadowed in the scope you're trying to use it – diedu Oct 14 '20 at 06:02
  • You are absolutely right! I inspected __proto__ and there are all the functions. Thanks for the feedback, very much appreciated. – George Oct 14 '20 at 15:58

0 Answers0