function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amit .Amit . 

Please help me in aura attribute failed while deploy the source to org from VS code. I am taking the standard attribute from lightning component library . i have done no changes in it but still it is failing with errorr invalid attribute name

<aura:attribute name="options" type="List" default="[ {'label': 'New', 'value': 'new'}, {'label': 'In Progress', 'value': 'inProgress'}, {'label': 'Finished', 'value': 'finished'}, ]"/>
User-added image
AbhinavAbhinav (Salesforce Developers) 
Hi Amit ,

I tried to replicated it  with this code
<aura:attribute name="options" type="List" default="[ {'label': 'New', 'value': 'new'}, {'label': 'In Progress', 'value': 'inProgress'}, {'label': 'Finished', 'value': 'finished'}, ]"/>
but wasnot getting any issue, could you share the entire code in code block (not as screenshot ) so that  I can try with detailed code.

Thanks!
mukesh guptamukesh gupta
Hi Amit,

Please share component code for further investigation.

Regards
 
Amit .Amit .
<aura:component implements="flexipage:availableForAllPageTypes">
    <lightning:card  title="Word Shuffle">  
        <aura:attribute name="modes" type="List" default="[
        {'label': 'Easy', 'value': 'easy'},
        {'label': 'Medium', 'value': 'medium'},
        {'label': 'Hard', 'value': 'hard'},
        ]"/>
      <lightning:combobox name="GameMode" label="Game Mode" value="easy" operations="{!v.modes}" placeholder="Select New Mode" />
        <lightning:button variant="brand" label="Start New Game" title="Start New Gam"  />
        <lightning:button label="Reshuffle" title="Reshuffle" />
    
    </lightning:card>
</aura:component>

 
Amit .Amit .
This showing the invalid attribute name error while saving in developer console
Sourabh Patidar 18Sourabh Patidar 18
Hi Amit,

Same issue with me as well, did you fin the solution eslwhere?

Thanks!
Sourabh Patidar 18Sourabh Patidar 18
Hello,

Just found out, the aura:attribute should be immediately agter the aura:component tag & not within the card. Below should work fine:
<aura:component implements="flexipage:availableForAllPageTypes">
     <aura:attribute name="modes" type="List" default="[
        {'label': 'Easy', 'value': 'easy'},
        {'label': 'Medium', 'value': 'medium'},
        {'label': 'Hard', 'value': 'hard'},
        ]"/>
    <lightning:card  title="Word Shuffle">  
      <lightning:combobox name="GameMode" label="Game Mode" value="easy" operations="{!v.modes}" placeholder="Select New Mode" />
        <lightning:button variant="brand" label="Start New Game" title="Start New Gam"  />
        <lightning:button label="Reshuffle" title="Reshuffle" />
    
    </lightning:card>
</aura:component>