Getting this error: Method “key” is only meant to be run on a single node. 0 found instead

I have the same issue as @glitton
Your solution, @besschua98, works in my local host but doest work on fCC.
I get this error: Method “key” is only meant to be run on a single node. 0 found instead.

I moved your question to a new topic, so we can focus on the problem you are having. Can you please post all the code your are currently using when you get this error?

When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

markdown_Forums

1 Like

Thanks @RandellDawson. My issue concerned only the variable renderOnline and so to deal with it I tried two approaches,
1.

const renderOnline = usersOnline.map((user, index) => { <li key={index}>{user}</li> })

this is solution from the previous challenge and gives the error and doesn’t work on my local host.

const renderOnline = usersOnline.map(x => <li key={x.username}>{x.username}</li>)

Now, when I tried again, it passed the test, but I wouldn’t come up with if it wasn’t for @besschua98

2 Likes

I am getting the same error. :frowning:

I understood the reason. I have made some changes in the state values. Thts why.