-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Description
Environment
React
version: 19.0.0Next
version: 15.1.4three
version: 0.172.0@react-three/fiber
version: 9.0.0-rc.2@react-three/drei
version: 9.120.6node
version: v23.4.0npm
version: 10.9.2
Problem description:
When using the EffectComposer component from react-three/postprocessing, I'm encountering a "Cannot read properties of undefined (reading 'length')" error. This error occurs in the useLayoutEffect hook of the EffectComposer component. The current behavior is problematic because it prevents the EffectComposer from initializing properly and applying post-processing effects to the scene.
Actuall Behavior
The application throws the following error:
EffectComposer.tsx:141 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at EffectComposer.useLayoutEffect (EffectComposer.tsx:141:40)
Steps to Reproduce
- Create a React Three Fiber scene
- Add an EffectComposer component to the scene
- Render the scene
Code Example
import React from 'react'
import { Canvas } from '@react-three/fiber'
import { EffectComposer } from '@react-three/postprocessing'
function Scene() {
return (
<Canvas>
<mesh>
<boxGeometry />
<meshStandardMaterial />
</mesh>
<EffectComposer>
{/* Your effects here */}
</EffectComposer>
</Canvas>
)
}
yuann-se and IAmTheAg
Metadata
Metadata
Assignees
Labels
No labels