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

[BUG] add() function does not exist in system in SphereRegistryComponent.System #15

Open
ResourceHog opened this issue Aug 25, 2019 · 2 comments

Comments

@ResourceHog
Copy link

ResourceHog commented Aug 25, 2019

create a default system with aframe-typescript-toolkit

npm run start

open console

index.ts:21 Uncaught (in promise) TypeError: this.system.add is not a function
at i.SphereRegistryComponent.init (VM1783 index.js:10035)
at i.updateProperties (component.js:270)
at HTMLElement.value (a-entity.js:501)
at HTMLElement.value (a-entity.js:474)
at a-entity.js:267
at a-node.js:129

upon inspection
this.system is undefined so of course this.system.add is not a function.
This behavior is strange doesn't aframe automatically add systems to components of the same name?

@ResourceHog
Copy link
Author

before running the add function setting this.system to the SphereRegistrySystem will fix this issue however we lose some type safety. We are essentially crossing our fingers and hoping that the types are correct here.

this.system = document.querySelector('a-scene').systems['sphere-registry'] as SphereRegistrySystem;

@joserick
Copy link

@ResourceHog Thanks for the code line, I hope @rachoac or @stormihoebe fix this sometime.

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