0

I'm implementing a simple lightning web component with and I could see the below warning in the browser console log. Can anyone help me understand why this is happening?

[LWC warning]: If property fields decorated with @api in [object:vm undefined (130)] is used in the template, the value Case_ID__c,Primary_Assigned_Case_Worker_Name__c,First_Name__c,Is_Rescricted_Case__c,Middle_Name__c,Hazard_Flag__c,Last_Name__c,Priority,Primary_Contact_Due_Date_Time_Formula__c,Complaint_Date_Time__c,Case_Begin_Date__c,Investigation_Submission_Date__c,Intake_Linked_Date__c,Intake_Decision_Date_Time__c,Supervisor__c,Intake_Allegation_Narrative__c,prepoderence_Finding__c,Next_Checklist_Due_Date__c,Next_Checklist_Stage__c,CreatedById,CreatedDate,LastModifiedById,LastModifiedDate,Last_Refresh_Date__c,ContactId,Status,Origin,SuppliedEmail,Subject,Description set manually may be overridden by the template, consider binding the property only in the template. aura_proddebug.js:242 at t.set (https://static.lightning.force.com/cs32/auraFW/javascript/NlYMGsCv2IRRXpX5txmc5Q/aura_proddebug.js:1753:32) aura_proddebug.js:242 at t.handleLoad (https://micps--cpsuat.lightning.force.com/components/lightning/recordForm.js:2:5931) aura_proddebug.js:242 at callHook (https://static.lightning.force.com/cs32/auraFW/javascript/NlYMGsCv2IRRXpX5txmc5Q/aura_proddebug.js:7725:19) aura_proddebug.js:242 at https://static.lightning.force.com/cs32/auraFW/javascript/NlYMGsCv2IRRXpX5txmc5Q/aura_proddebug.js:6573:13 aura_proddebug.js:242 at runWithBoundaryProtection (https://static.lightning.force.com/cs32/auraFW/javascript/NlYMGsCv2IRRXpX5txmc5Q/aura_proddebug.js:8255:13) aura_proddebug.js:242 at invokeEventListener (https://static.lightning.force.com/cs32/auraFW/javascript/NlYMGsCv2IRRXpX5txmc5Q/aura_proddebug.js:6567:9) aura_proddebug.js:242 at https://static.lightning.force.com/cs32/auraFW/javascript/NlYMGsCv2IRRXpX5txmc5Q/aura_proddebug.js:6101:13 aura_proddebug.js:242 at handleEvent (https://static.lightning.force.com/cs32/auraFW/javascript/NlYMGsCv2IRRXpX5txmc5Q/aura_proddebug.js:748:21) aura_proddebug.js:242 at HTMLElement.handler (https://static.lightning.force.com/cs32/auraFW/javascript/NlYMGsCv2IRRXpX5txmc5Q/aura_proddebug.js:753:13)

enter image description here

3
  • you probably want to 'copy paste' the warning in the post versus sharing an image.
    – glls
    Commented May 15, 2019 at 19:02
  • @glls.. updated the post
    – wesfaith
    Commented May 15, 2019 at 19:32
  • Can you provide minimum viable code to reproduce? Commented Aug 2, 2019 at 15:36

1 Answer 1

1

I believe that it is warning you that the @api property "fields" is being set programmatically by the .js side of your c-cps-case-details component. And if you were to set the "fields" property in the HTML / template side of things (i.e. if you were to have markup like ) that it can be overwrite that really long assigned field list value.

I guess if you really wanted to avoid this warning, you could create a @track property in your c-cps-case-details component and assign the lightning-record-form fields property to that new @track property, but i'm not sure how that would affect the User experience, as you may have to see the UI re-render before you get what you want.

1
  • Am quite interested? would you mind providing minimum viable code to reproduce this or playground link Commented Aug 2, 2019 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .