-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
QuadraticBezierLine component broken with @react-three/fiber version 8.0.18 and higher #2315
Comments
Broken box for refrence https://codesandbox.io/s/spaceman-forked-23lx8t |
this should be fixed with latest r3f, ... it's not? edit, React.useLayoutEffect(() => {
line2.computeLineDistances(); which then leads to (0, _defineProperty.default)(this, "computeLineDistances", () => {
const geometry = this.geometry;
const instanceStart = geometry.attributes.instanceStart;
const instanceEnd = geometry.attributes.instanceEnd;
const lineDistances = new Float32Array(2 * instanceStart.data.count); <--- crash, instanceStart is undefined |
@CodyJasonBennett it still seems related to the attach change made in .18-.19 despite the revert. i've debugged it a little and the instanceStart stuff is OK, it's being set by setPositions. the geometry is correct, instanceStart is not undefined, but it's later being used like so: return (
<primitive object={line2} ref={ref} {...rest}>
<primitive object={lineGeom} attach="geometry" /> and although this could be |
i can confirm now that it doesn't attach it, the uuid's don't match. what's on the line is the empty default buffergeom, the attach of the geometry created by the component is neglected for some reason. |
This is unrelated to multi-attach, but with #2268. Can reproduce since 8.0.18. |
Still broken on latest r3f and latest drei https://codesandbox.io/s/spaceman-forked-23lx8t I will close pmndrs/drei#946 as it looks like the root cause is not within drei? |
correct this is caused by r3f. when useLayoutEffect fires everything must be attached already, the view must be completed. but it looks like that isn't the case no more. |
three
version: 0.136.0 (tried lower and higher +/- 10 versions@react-three/fiber
version: 8.0.22@react-three/drei
version: 9.11.3node
version: v16.13.2npm
(oryarn
) version: npm version 8.1.2Problem description:
Increment to version 8.0.18 for @react-three/fiber or higher and observe 'cannot read property data of undefined` message.
App crashes :(
Relevant code:
https://codesandbox.io/s/spaceman-dz5jj0?file=/package.json
^ forked from example of
QuadraticBezierLine
.The text was updated successfully, but these errors were encountered: