AWS S3 JavaScript SDK – NetworkingError: Network Failure

Question:

I am trying to use the examples provided by AWS in their Examples in the Browser webpage, and I keep receiving the NetworkingError: Network Failure error. Here is what I am using:

My bucket is in the US Standard region, and I am trouble figuring out whether it uses us-west-2 or us-east-1. When I go to my bucket’s console, the URL is https://console.aws.amazon.com/s3/home?region=us-west-2 yet someone mentioned on here that US Standard is us-east-1.

Answer:

This error occurs because you don’t set the CORS configuration.

  1. Open the Amazon S3 console at https://console.aws.amazon.com/s3/.
  2. Select the name of the bucket you are using from the bucket list.
  3. Next, Choose “Permission” tab.
  4. Then in an editor titled “Cross-origin resource sharing (CORS)”, you need to make sure the S3 bucket has following CORS configuration:

Leave a Reply