I am a Salesforce developer. I am a beginner in this. So basically I am working on a particular page. This particular page is dependent on one apex class file and two LWC components. The code written in these files have no issues, yet when I deploy them successfully and test them, the page is not loading properly. It's not fetching any records. The strangest thing is same code is available both in higher org and lower org of our development. But when I log in to the portal through higher org, the page is working fine. But when I log in to the portal through lower org, page is not working at all.

So when I try to inspect why is it not working in lower org, it shows, "refused to load the script" as it violates content security policy

1 Answer 1


When you deployed LWC and Apex to the target orgs, make sure you also deploy any CSP settings your previous orgs have.

A developer in Salesforce creates a CSP setting as discussed in this help article.

  1. From Setup, enter CSP in the Quick Find box, then select CSP Trusted Sites. This page displays a list of any CSP Trusted Sites already registered, and provides additional information about each site, including site name and URL.
  2. Find Trusted Site.

Make sure your source and target orgs match and have the CSP settings configured.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.