SkuidLightningController error when loading skuid page via lightning component

  • 1
  • Problem
  • Updated 2 months ago
  • In Progress
  • (Edited)
I have a Skuid page which is throwing an error when the page is loaded, and the error only occurs when a non-admin user loads the page (i.e. it works fine for me). The error message is:

"Uncaught Error happened when processing action responses [Cannot read property 'addProblem' of undefined
Callback failed: apex://skuid.SkuidLightningController/ACTION$load]"

Some additional notes on how the page is deployed:

- deployed via Lightning Component inside a record detail page
- a lightning event is published after the page is loaded
- skuid theme files have been updated today
- we are running Millau 11.0.3
- page support files have been generated 

lightning component below:

<aura:component implements="flexipage:availableForRecordHome,lightning:actionOverride,force:hasRecordId,force:hasSObjectName" access="global" >
<aura:handler event="skuid:event" action="{!c.handleSkuidEvent}"/>
<aura:attribute name="showSpinner" type="Boolean" default="true"/>
    <aura:renderIf isTrue="{!v.showSpinner}">       
       <lightning:spinner variant="brand"  size="large" />     
    <skuid:page page="pageNameGoesHere" id="{!v.recordId}"/> 
Photo of Greg Jarrett

Greg Jarrett

  • 3,434 Points 3k badge 2x thumb

Posted 3 months ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 46,580 Points 20k badge 2x thumb
Gah, that's a bug. You should be seeing a red Skuid page problem message, not a Lightning error. Bleh...

Anyhow, the root issue is that there's a problem with some part of the loading of Models in your page. Maybe the user doesn't have permission to query some of the objects you're accessing, or there's a sharing error, something like that perhaps. So our goal is: figure out what that Model issue is.

First off --- does this only happen in Lightning Experience? Does the issue happen if the user previews the page from Visualforce? e.g. by going to /apex/skuid__UI?page=ThePageName ??? If it does, then you should see a red page problem in the Visualforce runtime, which should help you sort this out.

If not, and you have to debug this from Lightning Experience, then here's some things you can do:

(1) Remove Models from the page until it stops happening 
(2) Go into the JavaScript console and try to inspect the Models to see if you can find an error message.

If you have to debug this from within the JavaScript console in Lightning Experience ( wish there was a better way...), here's what you can do: In the console, enter the following:


This should return a Skuid API object. You can right-click on this object and "Store as a global variable". you should see something like "temp1" show up in the console. Then you can enter:

This gives you a "map" of all Models in the page. If the map doesn't contain the models that you were expecting, you probably have multiple Skuid Pages present in your Lightning Experience. IN that case you can specify exactly which page you want to debug by doing this:

$A.getEvt("skuid:apiDebugRequested").setParams({ page: "MyPageName" }).fire();

(replacing "MyPageName" with the name of the Skuid Page that is causing the issue)

Once you've got a reference to the Model you think is the problem, you can look at the model's "debug" or "soql" properties to see if there is anything helpful there, such as a query error message.
Photo of Greg Jarrett

Greg Jarrett

  • 3,434 Points 3k badge 2x thumb
I think we might be getting somewhere. The offender seems to be custom Salesforce action buttons. Once I remove these from the page (I had a number of them on 2 separate models) it loaded fine for the user.

So it appears to be a permissions issue that is preventing them from accessing those custom Salesforce buttons, however the page loads fine when deployed via a visualforce page.

One note which may or may not be relevant, I am testing this using the admin function to 'login as another user' (the user is in a different location and time zone to me so this is the easiest way to test).

Photo of Zach McElrath

Zach McElrath, Employee

  • 46,580 Points 20k badge 2x thumb
Ah, Custom Buttons! That is definitely something to work with. 
Photo of Greg Jarrett

Greg Jarrett

  • 3,434 Points 3k badge 2x thumb
Most of these buttons interact with Drawloop (document generation) - do you suggest we try and rebuild them with Skuid buttons? The advantage of having the Salesforce button is that it can invoke visualforce pages which invoke controllers that sit within the drawloop package.