Replies: 4 comments 3 replies
-
It doesn't seem related to r3f, do you have any public code we can take a look at? Or maybe even the deployed app |
Beta Was this translation helpful? Give feedback.
-
@belmer You should check the network tab to see if the object is being loaded without any errors. It might be being blocked by a CORS policy. These errors might not get surfaced to the console and instead by errors on the request itself. |
Beta Was this translation helpful? Give feedback.
-
Even with this sample code https://codesandbox.io/s/heuristic-leavitt-n7sd3?fontsize=14&hidenavigation=1&theme=dark building this on production has the same issue. I'm not sure if the UV maps contributes to the issue but this model for example have some UVs in it. |
Beta Was this translation helpful? Give feedback.
-
it doesnt look correct to me, the way you treat the model data. for instance, you dump a scene into the render graph, with a material, but scenes dont have materials in threejs. also, you're missing dispose={null}, if that component renders twice for whatever reason, r3f will dispose materials and geometries. (most likely that's your issue, the model will simply disappear) it looks to me you like you want to exchange gltf materials and meshes, it couldn't be easier if you use GLTFJSX: https://github.com/react-spring/gltfjsx plain threejs people are used to mutation and traversal, even changing a simple color is a complete mess for them. in react that's as comfortable as dealing with a SVG. https://codesandbox.io/s/focused-feistel-vkiym?file=/src/index.js |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've encountered this is issue when building or deploying to production. The model (glTF) was loaded but it's not showing on the screen. Checking on the console, there was no error logs at all. There is the
<canvas>
on the markup but the screen is blank. On my local machine, it works 100%. I'm using create-react-app by the way. So is there a proper way to deploy react-three-fiber to production?Beta Was this translation helpful? Give feedback.
All reactions