LightningContainerExamples icon indicating copy to clipboard operation
LightningContainerExamples copied to clipboard

lightning container not loading the react app

Open vidhyasagaran88 opened this issue 7 years ago • 1 comments

[myreactapp.zip] react build.zip(https://github.com/developerforce/LightningContainerExamples/files/1444587/myreactapp.zip) **Error:**Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src https://vsagar88-dev-ed.lightning.force.com 'nonce-efdac55b-dd68-9223-2c42-d77479799a1e' chrome-extension: https://sfdc.azureedge.net https://*.na35.visual.force.com https://ssl.gstatic.com/accessibility/”). Source: call to eval() or related function blocked by CSP app: <aura:application > <c:ReactContainerCmp /> </aura:application> cmp: <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" > <lightning:container src="{!$Resource.myApp + '/index.html'}"/> </aura:component>

vidhyasagaran88 avatar Nov 06 '17 00:11 vidhyasagaran88

Have you tried removing the slash in "/static/..." in build/index.html ?

I also have to manually add manifest.json in build/

{
    "landing-pages" : [
        {
            "path": "index.html",
            "apex-controller": "ApexController",
            "content-security-policy-type": "low"
        }
    ]
}

It could load the React App but still got error after callApex.

vinhhungle avatar Jan 06 '18 07:01 vinhhungle