Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty schema causing errors because _schema is undefined #85

Closed
LelouBil opened this issue Jul 22, 2020 · 1 comment
Closed

Empty schema causing errors because _schema is undefined #85

LelouBil opened this issue Jul 22, 2020 · 1 comment

Comments

@LelouBil
Copy link

Hello, I was having a strange error while creating a room and I managed to narrow it down to having an empty schema class.

TypeError: Invalid value used in weak set in line 68 of SchemaSerializer.js, in the hasFilter function.

I'm not familiar enough with the code to submit a pr but I managed to found this while investigating the issue.

knownSchemas.add(schema); was giving the error because schema was undefined, because _schema of the class was undefined.

I tried adding a random property to my schema and _schema got defined.

I think an empty schema should have {} instead of undefined for _schema.

I don't actually know when or why it was undefined so I'm reporting the issue here.

@endel
Copy link
Member

endel commented Jul 23, 2020

Hi @LelouBil, thanks for reporting. Version 0.14 of Colyseus is coming soon, along with an updated version of @colyseus/schema that should fix this, along with many other issues (#75, #82)

@endel endel closed this as completed Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants