Menu

1 / 2

How One Line of JavaScript Took My Entire Website Down for 11 Hours

#hackernoon#technology#chunk#const#name
Long article (1005 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

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.includes('/node_modules/')) return 'vendor'; if (includesAny(normalizedId, ONE_WAY_CHUNK_MATCHERS)) return 'one-way'; if (includesAny(normalizedId, TIPS_CHUNK_MATCHERS)) return 'tips'; if (includesAny(normalizedId,…

Continue reading — create a free account

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