Getting TypeError when uploading file to S3 bucket using aws-amplify

Viewed 158

I am using aws-amplify with react-native expo. Firstly, I created a demo app to check if s3 is working, I was successful in configuring Aws-amplify and s3 bucket on the demo application.

Now I want to use the same bucket and configs for My actual project

I followed the amplify-docs to use one backend across multiple apps.

Then in my actual project I used:

amplify pull --appId <myappid> --envName dev

It was successfully pulled but when I tried to upload image, or any text like:

const result = await Storage.put("imageName.txt", "Hello world");

I got the error Error uploading file: [TypeError: undefined is not an object (evaluating 'data.byteLength')]

One different thing I did when pulling the backend metadata was that I didn't use Access Keys but the other alternative, however I used Access Keys in demo project.

Did this happen because of different auth method?

Anyone knows why I am getting the error?

Help would be appreciated

0 Answers
Related