0

Hi Thanks in advance for your help.

The project I am developing is an adaptation of https://codesandbox.io/s/r3f-wouter-routes-7kohn

I have split the project above into a larger project structure making use of web pack and other dependencies. My project with the bug can be viewed here:- https://codesandbox.io/s/cranky-wood-hmub1

If that codesandbox does not work for you, you can clone from here:-

Steps to re-produce the bug:

  • Click on knot or bomb ( Top right hand navigation Menu ).
  • The knot or bomb model loads then disappears. Console mentions a shader error.

Known research:

  • I believe the bug is found within /components/shapes/index.tsx.
  • For some reason when switching the route to load a different model, the material class for the model to switch to fails its as if its not cached or does not have time to execute? I have tried wrapping the models in a suspense but that does not make a difference.

Here is the console error:

enter image description here

Max Silva
  • 477
  • 1
  • 7
  • 15

1 Answers1

0

All objects should be stored in useState() if they are within the render function.

Max Silva
  • 477
  • 1
  • 7
  • 15