i Have created one event-:

<aura:event type="COMPONENT" description="Event template" access="GLOBAL">
    <aura:attribute name="comp" type="Object"/>

One application

<aura:application extends="force:slds" access="GLOBAL" useAppcache="true">
<aura:attribute name="components" type="Object[]"/>
<aura:attribute name="ShowComponent" type="Boolean" default="True"/>
<aura:handler name="compEvent" event="c:WM_Navigation" action="{!c.eventHandler}"/>

    <aura:if isTrue="{!v.ShowComponent}">
    <c:EventFirstComponent />

    <div class="slds"> 
        <div class="slds-size--1-of-1"> 
           <div class="slds">        
                <aura:iteration items="{!v.components}" var="cmp">




    eventHandler : function(component, event, helper) {
    var obj = event.getParam('comp');
        console.log('event in app builder:'+JSON.stringify(obj));        
        var componentsToBeCreated = [];
            function(createdComponents, status,errorMessage){
                if (status === 'SUCCESS') {
                    component.set("v.components", createdComponents);
                    window.scrollTo(0, 0);  
                else if (status === "INCOMPLETE") 
                    console.log("No response from server or client is offline.");
                    else if (status === "ERROR") 
                        console.log("Error: " + JSON.stringify(errorMessage));


first component

<aura:component >
  <aura:registerEvent name="compEvent" type="c:WM_Navigation"/>
   Hello Welcome to Event Component.
   <lightning:button variant="brand" label="Submit" onclick="{!c.handleClick }" />


    handleClick : function(component, event, helper) {
       var compEvt = component.getEvent("compEvent");

       // compEvt.setParams({"comp":["c:EventSecondComponent"]});
       alert('Enent fi');
        compEvt.setParams({"comp":["c:EventSecondComponent" ,{}] }) ;
        alert('Enent else');


when i am firing this event i am getting this error

Error: [{"status":"ERROR","message":"An internal server error has occurred\nError ID: 41061075-30796 (-488974888)"}]

2 Answers 2

  1. did you registerEvent on the sending child component
  2. do you have event handler on the parent component you cant fire component in the .setParams only attribute, it should look something like this

     var myEvent = component.getEvent("EventName");
     myEvent.setParams({ attributeName: attributeName });

In your EventFirstComponent controller you are passing c:EventSecondComponent as parameter. So you are passing a Component as the parameter to be added dynamically in the application.

compEvt.setParams({"comp":["c:EventSecondComponent" ,{}] }) ;

Please check whether EventSecondComponent is already present in the Org. If not then you have to create it. It will solve the internal server error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .