Next.js Discord

Discord Forum

2D assets loading before loading.tsx, then loading.tsx only shows while loading 3D assets

Unanswered
Turkish Van posted this in #help-forum
Open in Discord
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 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
Turkish VanOP
@Turkish Van Click to see attachment
Turkish VanOP
the website loads for a split second then the loading screen appears
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?