I see sometimes CORS errors while loading map using Layer.fromPortalItem({}).
I notice "X:Cache Errors from cloudfront" in the request headers.
Since this is not always reproducible, I wonder if the CORS errors are due to this reason. Is there any other area I need to look at? Or is there any configurations to avoid CORS errors while loading map using ArcGIS Online item Id?