Lightning container : index.html not in the right folder

I try to use the lightning container to display an element in a salesforce component.
So, I have this code :

<aura:component access="global">
    <lightning:container aura:id="timeline"
        src="{!$Resource.myProject+ '/index.html'}"/>
</aura:component>

But it doesn’t work, the browser try to load the index.html file in the wrong address :

myaddress.container.lightning.com/lcc/1501081198000/myProject/index.html?sfdcIFrameOrigin=myaddress.lightning.force.com

whereas the file is at this address :

myaddress.lightning.force.com/resource/1501081198000/myProject/index.html

My index.html file is in the static resource folder.

So, do you know how I can do to take the file on the right folder or how I can choose the folder ?

Answer

Just one additinal information to the previous one:

If I try to load directly the html from the resolve URL without the lcc in the url like that:

<lightning:container aura:id="ReactApp"
                       src="https://pve-poc-dev-ed--c.container.lightning.com/lcc/1508416411000/schedulingComponentVisjs/index.html"
                       onmessage="{!c.handleMessage}"
                       onerror="{!c.handleError}"/>

I got this funny message from SF:

The src attribute must not begin with '/lcc/'. We received: /lcc/1508416411000/schedulingComponentVisjs/index.html

Attribution
Source : Link , Question Author : Adrien , Answer Author : robertovg

Leave a Comment