Menu

Our 3D configurator kept crashing on iPad. The bug was innerWidth < 768
📰

Our 3D configurator kept crashing on iPad. The bug was innerWidth < 768

DEV Community: ios·Kastomiko·about 10 hours ago
#gcCdugcC
#devtoios#devto#dev#webgl#crash
Reading 0:00
15s threshold

We make a minifigure configurator : the customer puts together a figure in 3D, sees the price, and orders. It runs in production on kloniko.store .

For a while iPad users saw "A problem repeatedly occurred" in Safari and "Can't open this page" in Chrome. No error in Sentry, no error boundary triggered. The tab just died.

The cause: iPad got the desktop budget

Every "light" branch in our code was guarded by screen width:

const isPhone = window . innerWidth < 768 ;

Enter fullscreen mode

Exit fullscreen mode

On a phone we lowered the pixel ratio, turned off ambient occlusion and bloom, and kept one 3D snapshot slot. An iPad is 820–1366 px wide, so it got the desktop path: on the frame layout step it had up to two live 3D figures plus three parallel snapshot renderers, each with post-processing.

But the memory available to a tab on an iPad is close to an iPhone, not to a laptop.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.