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
Jennifer PratherJennifer Prather 

LWC Error Message

I received an error when testing a lightning web component. 

Invalid key value "[object Object]" in [Object: vm undefined (93)]. Key must be a string or number.

I am not sure what this error means or what it is referrencing. Does anyone know what this means?
AbhishekAbhishek (Salesforce Developers) 
Hi Jennifer,

This below blog might answer your query,

https://salesforce.stackexchange.com/questions/254421/using-wired-property-in-lwc

The blog status same error as yours.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks.
Jennifer PratherJennifer Prather
Thank you but I am not using a wire service. I am trying to create a data table with the ability to input information.
Roy SouravRoy Sourav
Hi Jennifer,

I think you are trying to change an object to string .. that's is where you are getting the error message. 
Felix van Hove 22Felix van Hove 22
For those who are still wondering: (This typically happens after user Javascript has successfully executed; the browser then fails to build the page.) One reason: You have a <template for:each={items} for:item="it"> , you assigned a list of objects to these items, but the code in your loop expects "string or number", e.g. you set the name of a button referring to "it".
Daniel Soares 1Daniel Soares 1

Hello Felix,

Yeah, I also already noticed that. But is there anyway how to solve it?

To me is pretty anoying because if I run with Debug Mode Off it loads the component without any issue, but if I activate it (Debug Mode On), every component that has a template iteration similar to what you described, fires the Error: Invalid key value "[object Object]"...