I have created a lightning component which host the code for
lightning:Map. The component is loading fine in Salesforce but in Communities, I am having the following error:
Access to resources from an unapproved, external host violates your Content Security Policy (CSP). To get access to these resources, try whitelisting the host in CSP Trusted Sites in Salesforce Setup. More Details
Blocked URI: https://5e7f3496-9b88-3b86-7d4a-7fd47535be70.a.forceusercontent.com CSP directive: frame-src
I tried to whitelist the url but the thing is that each time the component is being reloaded, the hash in the url changes.
Has anyone got a workaround on how to load the
lightning:Map component without this error message.
The component code is exactly as in the Salesforce Documentation. We have not changed anything and works fine in Salesforce environment but not on community. lightning:Map source code example