2D assets loading before loading.tsx, then loading.tsx only shows while loading 3D assets
Unanswered
Turkish Van posted this in #help-forum
Turkish VanOP
I am facing an unexpected bug. On my page I have a bunch of 2D images and assets and one 3D model. When I open the website, the 2D assets show, then the loading.tsx file shows and then disappears when the 3D asset loads.
12 Replies
@Turkish Van I am facing an unexpected bug. On my page I have a bunch of 2D images and assets and one 3D model. When I open the website, the 2D assets show, then the loading.tsx file shows and then disappears when the 3D asset loads.
Can you share your file structure and how you load the 2D and 3D Parts? That would be helpful
Turkish VanOP
@Turkish Van https://github.com/dvm-bitspilani/oasis-2024-web
Having the 3D Model in it's own suspense solved the issue. You can see an example here: https://codesandbox.io/p/github/B33fb0n3/oasis-2024-web/main?import=true
As you can see, the 3D Model is now wrapped inside his own suspense boundary. Like that the 2D Assets are instantly loaded and the 3D Model will load show it's own loading state until its loaded
As you can see, the 3D Model is now wrapped inside his own suspense boundary. Like that the 2D Assets are instantly loaded and the 3D Model will load show it's own loading state until its loaded
Turkish VanOP
@Turkish Van Click to see attachment
Turkish VanOP
the website loads for a split second then the loading screen appears
@Turkish Van the website loads for a split second then the loading screen appears
yea, I know, you already said that here: https://nextjs-forum.com/post/1277313428360265800#message-1277313428360265800
And [as I said](https://nextjs-forum.com/post/1277313428360265800#message-1277510814965694467): put the Slot Machine in it's own suspense boundary. You also got an working example with your code [here](https://codesandbox.io/p/github/B33fb0n3/oasis-2024-web/main?import=true)
And [as I said](https://nextjs-forum.com/post/1277313428360265800#message-1277510814965694467): put the Slot Machine in it's own suspense boundary. You also got an working example with your code [here](https://codesandbox.io/p/github/B33fb0n3/oasis-2024-web/main?import=true)
Turkish VanOP
sorry for the trouble but like could you tell me where exactly have you placed the suspense boundary
I placed it inside the
Lading.tsx. You can see on the left, that I modified only one file. Attached you see, that there is now no double loading@Turkish Van solved?