Importmap CORS issue

I am adding ActionText / Trix into existing Rails 6 app without Webpacker.

Everything is working fine in dev through importmap-rails gem.

In production, assets are served from s3/cloudfront bucket. All of the other assets are being fetched without any issues as before.

New application.js is blocked though and console is warning:

Access to script at '' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I tried to make the respective file public in S3 and also added CORS policy:

        "AllowedHeaders": [
        "AllowedMethods": [
        "AllowedOrigins": [
        "ExposeHeaders": []