Closed alvarosabu closed 2 months ago
I think this is a problem with nodeOps
in the core:
const { registerCamera } = child?.__tres?.root as TresContext;
The optional chaining (?
) signals that one might expect undefined
is sometimes returned. undefined
can't be destructured:
$ node
> { foo } = undefined
Uncaught TypeError: Cannot destructure property 'foo' of 'undefined' as it is undefined.
On the team Discord, @garrlker and I were just briefly talking about passing in context
in order to factor out some of this optional chaining and long lookups.
I'll go ahead and open a PR for that refactor today. It should fix this issue.
There wasn't a camera in the demo and that made v4
nodeOps throw.
It'd be great if we always had a dummy camera in Tres.
I'll close this one, if this is not complete please feel free to re-open @andretchen0
Describe the bug
Lensflare seems to be broken on v4
Cannot destructure property 'registerCamera' of '(intermediate value)(intermediate value)(intermediate value)' as it is undefined.
Reproduction
Run local playground
Steps to reproduce
No response
System Info
Used Package Manager
pnpm
Code of Conduct