-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Cannot read properties of undefined (reading 'dispose') - GridHelper #721
Comments
Looks like we're calling |
@andretchen0 is this solved by the disposal refactor? |
Most likely. I will make a test from the reproduction and add it to the nodeOps tests. |
Following up, this is indeed a problem with Tres This test against it('disposes a GridHelper', () => {
const gridHelper = nodeOps.createElement('TresGridHelper', undefined, undefined, {})
expect(() => nodeOps.remove(gridHelper)).not.toThrow()
}) |
I see you're assigned here. Fwiw, the issue is fixed in a soon-to-be submitted PR dealing with primitive/disposal. When I submit, I'll mark that PR as closing this issue, if that's ok. |
Just for future reference, it is interesting:
The bug stems from these 2 competing disposals:
By the time Tres calls That makes THREE's perfectly valid assumption wrong, unfortunately. THREE tries to do |
Describe the bug
When i try to show/hide the GridHelper i get a TypeError. The code still works.
I tried it on an older tresjs version and no typeError happend.
<TresGridHelper v-if="gridHelper.visible" :args="[10, 100, 0xff0000]" />
Not sure if that is also the case for other components.
Reproduction
https://stackblitz.com/edit/tresjs-basic-hfgtuj
Steps to reproduce
Use the reproduction, click on the button 'Toggle Grid' and check the console logs.
System Info
Used Package Manager
npm
Code of Conduct
The text was updated successfully, but these errors were encountered: