i am trying to use a wrapper class list in aura:attribute i am getting the error org.auraframework.throwable.AuraRuntimeException: attribute is of the wrong type:

i'm not sure why this is happening


<aura:component controller="DispositionController" implements="force:appHostable,flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes">   

<aura:attribute name="inventoryList" type="lotWrapper[]" default="[]" description="This attr. will hold all product Info"/>

</aura:component >

Apex class

public class lotWrapper {

@AuraEnabled public list<string> reasonToChange{get;set;}

@AuraEnabled public string newStatusVal{get;set;}

@AuraEnabled public string allocateAttrVal{get;set;}

@AuraEnabled public List<productListwrap> productListwrap{get;set;}

public lotWrapper(){

    public class productListwrap

    @AuraEnabled public Inventory_Detail__c invDetail{get;set;}


any help appreciated this is really urgent to me

getting this error

  • Do you have an attribute called items somewhere - the message looks like it does not relate to inventoryList.
    – Keith C
    Apr 5, 2017 at 8:28
  • Yes, and also can you show us the iteratator that is iterating on the items array Apr 5, 2017 at 8:35
  • Post the apex code which returns the list of wrapper to the component side. Apr 5, 2017 at 11:22
  • Try removing default="[]" for your inventoryList attribute. It solved problem for me. You could use 'init' event and set value from js handler (helper or controller) if you really need default for that.
    – wesaw
    Aug 19, 2017 at 18:37


You must log in to answer this question.