Connected app components are not displaying in our customers' orgs. Randomly the components are not loaded into their respective divs. Roughly 95% of the time they AREN'T loaded. If we disable cache or in chrome change the network to 3g speeds they load every time. This isn't occurring in our Scratch Orgs, but only on the customer orgs; testing is very difficult.

If we look in the console the javascript for the missing components is being run, so they are getting loaded in some way, just not being added to the page. Here's the javascript code for adding the components:

     function() {
                $Lightning.createComponent("MyPackage:Foo",{ },"Foo",function(cmp) {});
                $Lightning.createComponent("MyPackage:Bar",{ },"Bar",function(cmp) {});
                $Lightning.createComponent("MyPackage:Baz",{ },"Baz",function(cmp) {});
                $Lightning.createComponent("MyPackage:Bop",{ },"Bop",function(cmp) {});


(the page is mostly just a pass through for displaying these components, and there is little else on the page but this code)

We also tried adding delays to this code, but it made the problem occur 100% of the time in customer orgs. The delay worked fine in our Scratch orgs.

Curiously, I created a package with most components removed and it began to work not at all, but I think that may just have been a side effect of removing too many components.

I am certain it is a race condition but I'm not sure how to solve it.

1 Answer 1


Ok, pretty basic, I just made sure the divs were loaded before running $Lightning.createComponent. Not sure why it didn't work if there was too much delay.

You must log in to answer this question.

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