2

In Winter '21 we have started getting a CORS error when loading resources from static resources. We believe it relates to this.

If this is the intended behaviour, what is the recommended way of sharing resources between lightning components?

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://post-test-org-ent-ed--org3--staticresourcet.visualforce.com/resource/1601918961000/staticresourcet__CommonBundle/vendor/orgApps/LightningUtility.js?staticResourceOrigin=https%3A%2F%2Fpost-test-org-ent-ed--org3.lightning.force.com. (Reason: CORS header 'Access-Control-Allow-Origin' does not match 'https://post-test-org-ent-ed--org3.lightning.force.com').

This is the code i'm using to test this issue out.

<ltng:require scripts="{!join(',',
                       $Resource.staticresourcet__CommonBundle + '/vendor/orgApps/LightningUtility.js')}"
              afterScriptsLoaded="{!c.init}" />

We have only seen this in lightning aura components.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.