function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
balraj singh 33balraj singh 33 

Lightning Aura container CORS issue

I have below VF page which has lightening components in it :
I is giving error while loading for FSL:optInsightHealthCheck . Error message 'No 'Access-Control-Allow-Origin' header is present on the requested resource.'
<apex:page standardController="FSL__Optimization_Request__c"> <apex:includeLightning /> <br /> <div> <table > <tr> <td valign="top"> <div id="optimizationInsightsMetrics" /> <br /> <div id="optimizationInsightsKPIs" /> </td> <td valign="top"> <div id="optimizationInsightsSummary"/> <br /> <div id="optInsightHealthCheck" /> </td> </tr> </table> </div> <script> $Lightning.use("c:OptimizationInsightsAura", function() { $Lightning.createComponent("FSL:optimizationInsightsKPIs", { recordId : '{!$CurrentPage.parameters.Id}',label : "KPI" }, "optimizationInsightsKPIs", function(cmp) { } ); $Lightning.createComponent("FSL:optimizationInsightsMetrics", { recordId : '{!$CurrentPage.parameters.Id}',label : "Metrics" }, "optimizationInsightsMetrics", function(cmp) { } ); $Lightning.createComponent("FSL:optimizationInsightsSummary", { recordId : '{!$CurrentPage.parameters.Id}',label : "Summary" }, "optimizationInsightsSummary", function(cmp) { } ); $Lightning.createComponent("FSL:optInsightHealthCheck", { recordId : '{!$CurrentPage.parameters.Id}',label : "Health Check" }, "optInsightHealthCheck", function(cmp) { } ); }); </script> </apex:page>
SwethaSwetha (Salesforce Developers) 
HI Balraj,
Are you using any external Libraries/Static resources in the lightning component( FSL:optInsightHealthCheck) which is not CORS whitelisted?

Recommend reviewing https://salesforce.stackexchange.com/questions/51193/xmlhttprequest-cannot-load-no-access-control-allow-origin-is-present

If this information helps, please mark the answer as best. Thank you