Ask coding questions

← Back to all posts
Errors do not show up in my console
h
p1ckl3

I am building a super simple repl db chat(I know not the best) and encounter no errors whatsoever. When I go on antother device, I get an error. What is going on? Theres no error when I run it. Error Here:

Traceback (most recent call last):
File "main.py", line 15, in <module>
'messages' : db['chat']
TypeError: 'NoneType' object is not subscriptable

Anyone know?

Voters
p1ckl3
Comments
hotnewtop
CosmicBear

The error is that db["chat"] doesn't exist. Add db["chat"] = whatever
But also, remove lines 14,15, and 16. There is no reason for them to be there except to make things more complicated. There is a good chance that I am wrong though.

p1ckl3

Like this @CosmicBear? I changed line 15

CosmicBear

@okalisl line 15 has no reason to be there. It doesn't do anything.

CosmicBear

@okalisl What type of array is db["chat"] supposed to be?