0

I'm getting the following error from Salesforce whenever I try to create a Lightning Web Component app:

Action.prototype.finishAction Error [Error in $A.getCallback() [Assert Violation: Compiler Error: A @track decorator can only be applied to a public field.] Callback failed: serviceComponent://flexipage.editor.aura.component.FlexipageComponentController/ACTION$loadComponentDefinitions] new Aura.externalLibraries()@https://rlscn--rules.lightning.force.com/auraFW/javascript/pxtF0ZdGYF-z00XsmRUcGQ/aura_proddebug.js:25795:23 {anonymous}()@https://rlscn--rules.lightning.force.com/auraFW/javascript/pxtF0ZdGYF-z00XsmRUcGQ/aura_proddebug.js:20710:1

Basically, if I don't use the @track decorator, the error doesn't show. However, using them would be important in my implementation as there are certain values that need to be reflected on my interface. I need these in my app, but my app quite simply won't let me use them. My question is, why exactly is this happening and what can I do to get past this issue?

2
  • 3
    hi, please share the component code - otherwise it is difficult to support you – Renji-xD Jun 14 '19 at 18:20
  • I wasn't sure if it would've been smart to put all the code here, but here it is through Codeshare. Just to reiterate here, I don't expect an edit (as I know some would probably alter on the page itself), I just need to know why this is happening and how to solve it. codeshare.io/G6ndwz – Anthony Jun 14 '19 at 19:12
6

Couple of your tracked properties have redundant getters (e. g. regionOptions or shippingSpeedOptions etc.). When you are decorating properties you should not add additional getter / setter for them - that is not allowed. Check your whole Class, remove getter / setter for everything where you are using the @track decorator and then the error should be gone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.