title: Access to image has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
body: <p>All I have to do is generate specific JSX and download it as pdf-file. I use <a href="https://www.npmjs.com/package/react-to-pdf" rel="nofollow noreferrer">react-to-pdf</a> library and it works fine but it ignores images stored in AWS S3 bucket that are loaded fine in JSX img-component.</p>
  <p>A full error looks like this:</p>
  <blockquote>
  <p>Access to image at 'https://s3-eu-west-1.amazonaws.com/my-bucket/my-cool-image.png?ver=1663764527047' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.</p>
  </blockquote>
  <p>Here is my Bucket policy:</p>
  <pre><code>{
      &quot;Version&quot;: &quot;2012-10-17&quot;,
      &quot;Statement&quot;: [
          {
              &quot;Sid&quot;: &quot;PublicReadGetObject&quot;,
              &quot;Effect&quot;: &quot;Allow&quot;,
              &quot;Principal&quot;: &quot;*&quot;,
              &quot;Action&quot;: &quot;s3:GetObject&quot;,
              &quot;Resource&quot;: &quot;arn:aws:s3:::my-s3-bucket/*&quot;
          },
          {
              &quot;Effect&quot;: &quot;Allow&quot;,
              &quot;Principal&quot;: &quot;*&quot;,
              &quot;Action&quot;: &quot;s3:GetBucketCORS&quot;,
              &quot;Resource&quot;: &quot;arn:aws:s3:::my-s3-bucket&quot;
          }
      ]
  }
  </code></pre>
  <p>And here is CORS settings:</p>
  <pre><code>[
      {
          &quot;AllowedHeaders&quot;: [
              &quot;*&quot;
          ],
          &quot;AllowedMethods&quot;: [
              &quot;HEAD&quot;,
              &quot;GET&quot;,
              &quot;PUT&quot;,
              &quot;POST&quot;,
              &quot;DELETE&quot;
          ],
          &quot;AllowedOrigins&quot;: [
              &quot;*&quot;
          ],
          &quot;ExposeHeaders&quot;: [
              &quot;x-amz-server-side-encryption&quot;,
              &quot;x-amz-request-id&quot;,
              &quot;x-amz-id-2&quot;,
              &quot;ETag&quot;,
              &quot;Access-Control-Allow-Origin&quot;
          ],
          &quot;MaxAgeSeconds&quot;: 3000
      }
  ]
  </code></pre>
  <p>I tried different CORS and Bucket policy configurations but none of them worked as expected.</p>