I have a lightning component which uses external libraries like d3.js and jquery. I have to use this this component in a lightning page as well as show it on the record detail page of a custom object. I am doing this by using adding the component in an app which is then added to the visualforce page by Lightning Out. Some Observations are:
- Opening the visualforce using the classic url (/apex/mypage) works fine.
- In the record detail page, it throws a cross origin frame error.
- If I remove the
ltng:requirefrom the component and remove the loading of the d3 and jquery static resource, it works in the detail page (but does not render charts and stuff obviously unless I import it in the vf page(but I need it run independently as well)).
How do I fix this error or render the lightning component in the record detail page through lightning out.
Sample Code: https://jsfiddle.net/2rf4qq6t/