I recieve the below error when I am trying to call a Custom Lightning Component in a Visualforce page that is used in Communities.

  • Unrecognized Content-Security-Policy directive 'reflected-xss'.
  • logo180.png Failed to load resource: the server responded with a status of 404 (Not Found)
  • CommunityHomePage:1 Uncaught SyntaxError: Unexpected token w in JSON at position 0 at JSON.parse () at XMLHttpRequest.xhr.onreadystatechange (lightning/lightning.out.delegate.js?v=ZCuyRUYzK_kAf4cKCIeS2A:143)
  • My Component

    <aura:component controller="LeadController" implements="forceCommunity:availableForAllPageTypes">
        <aura:attribute name="theLead" 
            default="{ 'sobjectType': 'Lead',
                       'Rating__c': 2,
                       'Company': '',
                       'FirstName': '',
                       'LastName': '',
                       'Email': '' }"/>
            <ui:inputText value="{!v.theLead.Company}" label="Company" class="input"/>
            <ui:inputText value="{!v.theLead.FirstName}" label="First" class="input"/>
            <ui:inputText value="{!v.theLead.LastName}" label="Last" class="input" />
            <ui:inputEmail value="{!v.theLead.Email}" label="Email" class="input" />
            <ui:button label="Save" press="{!c.save}"/>

    My Lightning App is

    <aura:application access="GLOBAL" extends="ltng:outApp" implements="forceCommunity:availableForAllPageTypes">
        <aura:dependency resource="c:CommunityChatter"/>

    My VF Page is

    <apex:page standardController="Lead">
        <apex:includeScript value="{!$Site.BaseUrl}/lightning/lightning.out.js"/>
            $Lightning.use("c:MyLightApp", function() {
                    function(cmp) {
                        console.log("Component created!");
        <div id="theLead"></div>

    2 Answers 2


    Found the Issue, It is just a Permission on the Profile for Lead.

    • 2
      Could you be more specific? Maybe it will help some people in the future with the same problem. Apr 10, 2017 at 7:23
    • Hi Martin, Sorry should have been more specific. Details are as below. Apr 20, 2017 at 4:44

    Better Answer:

    Since, I was trying to use this component in Customer Communities, I have to make the object available for the customer community profiles.

    You must log in to answer this question.

    Not the answer you're looking for? Browse other questions tagged .