Menu

1 / 2

One line blanked our whole React app: Vite manualChunks and the temporal dead zone

DEV Community: vite·Luca·11 days ago
#ArlwiuGe
#devtovite#devto#dev#chunk#const
Long article (1265 words) — no AI summary yet.
Reading 0:00
15s threshold

I build Candidate Falcon , a practice site for hiring assessments and one-way video interviews. At the start of November a release that added two new interview types reached production, and every page went blank. The login form didn't render, no button worked, and the console showed one error:

ReferenceError: Cannot access 'ko' before initialization

Enter fullscreen mode

Exit fullscreen mode

It stayed broken for about 11 hours, partly because our deploy checks said everything was fine. This post is about why one innocent-looking line caused it, and the two checks we added so it can't happen quietly again.

The setup: manual chunks

The app is built with Vite, and the Rollup output uses manualChunks to split the bundle by area of the site:

manualChunks ( id ) { const normalizedId = id . replace ( / \\ / g , '/' ) ;

if ( normalizedId .…

Continue reading — create a free account

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