-
-
Notifications
You must be signed in to change notification settings - Fork 6
TypeError: Failed to fetch - Error is showing while uploading images to aws #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Afsana1313 , Have you created a bucket in your AWS account? if yes, please replace |
Hi @NimperX, |
@Afsana1313 If you have set the correct permissions for the bucket, then you will get following screen when go to |
I have provided the bucketName in the config object but still I am getting failed to fetch error while uploading image or video on the s3 |
@jainesh2906 , Please double check your actual s3url if it is valid or not, the service you are using provided from aws, if you need to use any encrypted data |
This is the s3Url: 'https://dint.s3.amazonaws.com' I have added |
@jainesh2906 Is this fixed? If yes, please acknowledge. |
I am getting errors while implementing react-aws-s3-typescript. Here is my code -
function App() {
async function handleImageChange(e: any) {
e.preventDefault();
await getCredentials();
const config = {
bucketName: "bucketName",
dirName: "/dirName/Images",
region: "us-east-1",
accessKeyId: localStorage.getItem("accessKey"),
secretAccessKey: localStorage.getItem("secretKey")
};
const s3 = new ReactS3Client(config as IConfig);
let uploadedFile = e.target.files[0];
return (
<div className="App">
<input
className="select-image-btn"
type="file"
onChange={(e) => handleImageChange(e)}
/>
</div>);}
the Error I am getting is -
POST https://bucketName.s3-us-east-1.amazonaws.com/ net::ERR_NAME_NOT_RESOLVED
and
TypeError: Failed to fetch at ReactS3Client.<anonymous> (react-aws-s3.js:92:1) at step (react-aws-s3.js:44:1) at Object.next (react-aws-s3.js:25:1) at react-aws-s3.js:19:1 at new Promise (<anonymous>) at __webpack_modules__../node_modules/react-aws-s3-typescript/dist/react-aws-s3.js.__awaiter (react-aws-s3.js:15:1) at ReactS3Client.uploadFile (react-aws-s3.js:65:1) at handleImageChange (App.tsx:27:1)
I am unable to understand the reason for the error shown in the console. Can anyone help me in understanding the problem?
The text was updated successfully, but these errors were encountered: