I tried to use an application event in visualforce page using lighting out on my scratch org with namespace. But I was not able to get the app event in aura component.

I wrote following Aura Component, Aura Application Event, Aura Application for Lighting Out, and Visualforce Page.

Even if displaying myPage.page and clicking "Get event" button on myComp.cmp, but unable to get event in myAction method of myCompController.js.

I tried to replace mynamespace to c, but the result was same.

In scratch org without namespace and developer org with namespace, I could get the application event with same code.

So this problem seems to be bug of scratch org with namespace. Please fix this problem.


<aura:event type="APPLICATION" description="My App Event template"/>


<aura:component implements="flexipage:availableForAllPageTypes">
    <aura:registerEvent name="appEvent" type="mynamespace:myAppEvent"/>
        <div><button onclick="{!c.myAction}">Get event</button></div>


<aura:application extends="ltng:outApp">
    <aura:dependency resource="c:myComp" />


    <apex:includeLightning />
    <div id="lightning"></div>
        $Lightning.use("c:myCompApp", function () {
            $Lightning.createComponent("c:myComp", {}
                , "lightning", function (cmp, err) {});


    myAction : function(component, event, helper) {
        var event = $A.get('e.mynamespace:myAppEvent');
        console.log("evenet: ", event);


  "packageDirectories": [
      "path": "force-app",
      "default": true
  "namespace": "mynamespace",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "47.0"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.