utsuboco/r3f-perf

Error when adding a Drei <Text> component - Cannot read property 'muiPerf' of undefined

pfortes opened this issue ยท 3 comments

If you add a Text component from Drei to the scene r3f-perf fails with the error "Cannot read property 'muiPerf' of undefined"

r3f-perf.esm.js?1e43:524 Uncaught TypeError: Cannot read property 'muiPerf' of undefined
    at eval (r3f-perf.esm.js?1e43:524)
    at Text.traverse (three.module.js?5a89:7077)
    at Group.traverse (three.module.js?5a89:7083)
    at Scene.traverse (three.module.js?5a89:7083)
    at Array.eval (r3f-perf.esm.js?1e43:517)
    at run (react-three-fiber.esm.js?ef10:1287)
    at loop (react-three-fiber.esm.js?ef10:1326)

i have edited the basic codesandbox adding a test Text at https://codesandbox.io/s/perlin-cubes-forked-thrux so you can replicate the error easily.

am i doing something wrong like not having a material on the Text component or is this a edge case of the library?

Thanks for this amazing component!

@pfortes Thanks for the demo!
Indeed I forgot the derived materials as Troika (Text) makes a clone of the program it results in 2 programs and the new one breaks the tool. I will release a new version with a fix today.

@pfortes version 4.7.3 is published and fix the issue ๐Ÿ‘

Great, thank you!!