Cannot set properties of undefined when extending `container`
Hello! I wanted to create a property
entities
that holds two properties which would be users
and guild
of class Entity
. Now entities
doesn't have any type at all since it'll just be an object to hold users
and guild
in one. But whenever I run my bot I receive Cannot set properties of undefined (setting 'users')
Here's my augments:
And here's it is being initialized in setup.ts I tried moving the initialization inside my Client but I get the same error. Perhaps I'm missing something? Thank you for the help!5 Replies
Solution
You need to assign
.entities
, like this:Ah I see, that's all I have to change, my augments are fine as it is?
Yup, it is
I see, thank you for the quick response!!
augments are type only, you need to define runtime as well which is what Kyra showed.