I have 2 sibling components inside a visualforce page. When i try to write pubsub events in the LWC components i am getting the below error
This page has an error. You might just need to refresh it. Error in $A.getCallback() [afterRender threw an error in 'c:lwcContainer' [pubsub listeners need a "@wire(CurrentPageReference) pageRef" property]] Failing descriptor: {ltng:outApp}
VF Page Code
<apex:page>
<apex:includeLightning />
<div id="lightningvf" />
<script>
$Lightning.use("c:lwcvf", function() {
$Lightning.createComponent("c:lwcContainer",
{},
"lightningvf",
function(cmp) {
console.log("button was created");
// do some stuff
}
);
});
</script>
</apex:page>
i have used the below blog to create 2 lightning web components https://www.santanuatonline.com/publish-subscriber-model-in-lightning-web-component/
How do i communicate between these 2 sibling LWC's which are residing inside the vf page?