+ Start a Discussion
$hwet@$hwet@ 

call Component via VF page: $A.getCallback() [Cannot read property 'setParams' of undefined]

I have two lightning components and the first component is like a login page and once the login is successful the other component should be called. My code is working fine if I add the component in the record page but if I try to call the component via visualforce page it throws me the below error:
This page has an error. You might just need to refresh it. Error in $A.getCallback() [Cannot read property 'setParams' of undefined] Callback failed: apex://Userempid/ACTION$getContacts Failing descriptor: {c:NewLoginPage}

where c:NewLoginPage - the login pagei.e First component
Userempid - apex controller for the first component.

can you please help me with this.
 
Best Answer chosen by $hwet@
$hwet@$hwet@
According to Salesforce doc: https://developer.salesforce.com/docs/component-library/bundle/force:navigateToComponent/documentation

force:navigateToComponent event is handled by the one.app container. It’s supported in Lightning Experience and the Salesforce app.
 

All Answers

Raj VakatiRaj Vakati
Can you share the code ?
$hwet@$hwet@
According to Salesforce doc: https://developer.salesforce.com/docs/component-library/bundle/force:navigateToComponent/documentation

force:navigateToComponent event is handled by the one.app container. It’s supported in Lightning Experience and the Salesforce app.
 
This was selected as the best answer