Expand Minimize

Don't reference scripts from unapproved locations

Web Part references script from a location that hasn't been approved

CheckId SPF021301
TypeName DontReferenceScriptsFromUnapprovedLocationsInProject
Severity CriticalError
Type ProjectConfig

Different organizations have different policies regarding which resources are allowed to be accessed on the Internet. In some cases these policies are enforced by network configurations that blocks access to restricted resources.

When building SharePoint Framework client-side web parts developers can reference resources hosted on public CDNs or other locations on the Internet. If these locations are not allowed to be accessed from within the organizations, these web parts will break when used in production. Errors caused by such policies are hard to debug and costly to restore as they might occur only in production.

By loading resources from locations approved by the organization developers ensure that their web parts will work as expected.

Name Description
ApprovedScriptLocations ;-separated list of approved locations from which scripts can be referenced. Script reference must start with one of these paths. For example: https://cdn.contoso.com/
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.