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
Vishwas B NVishwas B N 

Error while adding Component to page

Hi Team,

I am getting below error when i add a custom LWC to a App page in app Builder. (The component was working perfectly eralier)

Action.prototype.finishAction Error  [Error in $A.getCallback() [Invalid observed finalpin field. Found a duplicate accessor with the same name.]
Callback failed: serviceComponent://flexipage.editor.aura.component.FlexipageComponentController/ACTION$loadComponentDefinitions]


Can you please help me in understanding what is going wrong here.

Thank you.
Best Answer chosen by Vishwas B N
Joseph Wildey 15Joseph Wildey 15
Be sure you don't have a field definition and a getter function with the same name.  The below is wrong and will give you that error:
export default class My_LWC_Component extends LightningElement {
    finalpin;   //OR @track finalpin, @api finalpin, etc.;
.....
    get finalpin() {   
        ....my finalpin code
    }

 

All Answers

SwethaSwetha (Salesforce Developers) 
HI Vishwas,
Based on similar scenarios I've seen for this error, this is an intermittent issue. Can you clear your browser cache and retry in some time and check if the issue still persists?Thanks
Vishwas B NVishwas B N

Hi Team,

Below is the additional detail on the above issue.

aura_proddebug.js:11392 Uncaught (in promise) TypeError: Invalid template returned by the render() method on [object:vm AdgRollupComponent (354)]. It must return an imported template (e.g.: `import html from "./AdgRollupComponent.html"`), instead, it has returned: function tmp() {
          if(entry[REQUIRELOCKER] || depEntry[REQUIRELOCKER]) {
            return lockerWrap(dep.$ns$, depDescriptor, entryDescriptor)
          }
          return dep.$ns$
        }.
    at aura_proddebug.js:11392


This is the error we see in the browser console when we load the app page.

Note : The same page works in QA Sandbox (v.21)
           Error only in Dev Sandbox (v.22)

 

 

Vishwas B NVishwas B N
This is seen after the win 22 changes deployed to sandbox.
Joseph Wildey 15Joseph Wildey 15
Be sure you don't have a field definition and a getter function with the same name.  The below is wrong and will give you that error:
export default class My_LWC_Component extends LightningElement {
    finalpin;   //OR @track finalpin, @api finalpin, etc.;
.....
    get finalpin() {   
        ....my finalpin code
    }

 
This was selected as the best answer
Vishwas B NVishwas B N
Thanks Joseph.

In my case, the the component had a track variable additional assignment, after declaration.