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

TypeError: Cannot read properties of undefined (reading 'elements') - MeshReflectorMaterial #2138

Open
sovetski opened this issue Oct 26, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@sovetski
Copy link

sovetski commented Oct 26, 2024

  • three version: 0.169.0
  • @react-three/fiber version: 9.0.0-alpha.8
  • @react-three/drei version: 9.115.0
  • node version: v20.10.0
  • npm (or yarn) version: 10.2.3

Problem description:

With the code below I am getting this error: TypeError: Cannot read properties of undefined (reading 'elements')

Relevant code:

          <mesh position={[0, -1.5, 0]} rotation={[-Math.PI / 2, 0, 0]}>
              <planeGeometry args={[50, 50]} />
              <MeshReflectorMaterial
                  blur={[400, 400]}
                  resolution={1024}
                  mixBlur={1}
                  mixStrength={15}
                  depthScale={1}
                  minDepthThreshold={0.85}
                  color="#dbecfb"
                  metalness={0.6}
                  roughness={1}
              />
          </mesh>
@sovetski sovetski added the bug Something isn't working label Oct 26, 2024
@abernier
Copy link
Member

@sovetski can you paste the error's calls stack?

@sovetski
Copy link
Author

@abernier sure:

TypeError: Cannot read properties of undefined (reading 'elements')
    at Vector3.setFromMatrixPosition (http://localhost:3000/_next/static/chunks/2fd53_three_build_three_module_bcbc2d.js:3488:21)
    at MeshReflectorMaterial.useCallback[beforeRender] (http://localhost:3000/_next/static/chunks/10bfa_@react-three_drei_c48812._.js:1652:36)
    at MeshReflectorMaterial.useFrame [as current] (http://localhost:3000/_next/static/chunks/10bfa_@react-three_drei_c48812._.js:1781:13)
    at update (http://localhost:3000/_next/static/chunks/1303a_@react-three_fiber_dist_b28a6f._.js:2092:26)
    at loop (http://localhost:3000/_next/static/chunks/1303a_@react-three_fiber_dist_b28a6f._.js:2118:23)

@puerschel93
Copy link

puerschel93 commented Dec 10, 2024

Same issue here. @sovetski could you fix it ?

using

"@react-three/drei": "^9.120.3",
"@react-three/fiber": "^9.0.0-alpha.8",

@samuelkime267
Copy link

Hi guys, I have the same issue here too
Any solution?

"@react-three/drei": "^9.120.4", "@react-three/fiber": "^9.0.0-rc.1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants