Bug: initialScale: 0 in Viewport Config Renders the Entire Site Unreadable on Mobile
π Issue Description
The root layout file app/layout.tsx exports a viewport configuration with initialScale: 0. This is a critical rendering bug β a zoom scale of 0 means the page is zoomed to 0% on load, making the entire site completely invisible/unreadable on every mobile browser the moment it's opened.
The correct value is initialScale: 1, which is the industry-standard default that renders the page at 100% zoom on mobile devices.
π Affected Code
File: app/layout.tsx β lines 24β29
export const viewport: Viewport = {
width: "device-width",
initialScale: 0, // β Renders page at 0% zoom β invisible on mobile
maximumScale: 5,
userScalable: true,
};
π₯ What This Does
The viewport meta tag generated by Next.js from this config becomes:
<meta name="viewport" content="width=device-width, initial-scale=0, maximum-scale=5" />
On any mobile browser (Chrome, Safari, Firefox for Android/iOS), initial-scale=0 sets the page zoom to zero on load. The user sees a blank or microscopic page and must manually pinch-zoom in to read anything β which most users will never attempt, and which defeats the maximumScale: 5 setting anyway since they start from 0.
π§ͺ Steps to Reproduce
- Open the site on any mobile device or use Chrome DevTools β toggle device toolbar (any phone preset)
- Navigate to any page (
/, /quiz, /sem4/os/ch1, etc.)
- Observe the page renders completely zoomed out (near invisible) on initial load
- Compare with
initialScale: 1 β the page renders normally at readable size
β
Fix
One character change in app/layout.tsx:
export const viewport: Viewport = {
width: "device-width",
initialScale: 1, // β
Standard value β renders at 100% zoom on mobile
maximumScale: 5,
userScalable: true,
};
This is the correct, universally-used value per the MDN viewport docs and Next.js viewport documentation.
π Impact
| Concern |
Detail |
| Severity |
π΄ Critical |
| Affected Pages |
Every single page on the site |
| Affected Users |
All mobile users (iOS + Android) |
| Behaviour |
Page renders at 0% zoom β effectively blank on load |
| Fix Complexity |
Trivial β single value change in one file |
π References
π·οΈ Suggested Labels
bug Β· frontend Β· mobile Β· critical Β· gssoc Β· level1
Bug:
initialScale: 0in Viewport Config Renders the Entire Site Unreadable on Mobileπ Issue Description
The root layout file
app/layout.tsxexports aviewportconfiguration withinitialScale: 0. This is a critical rendering bug β a zoom scale of0means the page is zoomed to 0% on load, making the entire site completely invisible/unreadable on every mobile browser the moment it's opened.The correct value is
initialScale: 1, which is the industry-standard default that renders the page at 100% zoom on mobile devices.π Affected Code
File:
app/layout.tsxβ lines 24β29π₯ What This Does
The
viewportmeta tag generated by Next.js from this config becomes:On any mobile browser (Chrome, Safari, Firefox for Android/iOS),
initial-scale=0sets the page zoom to zero on load. The user sees a blank or microscopic page and must manually pinch-zoom in to read anything β which most users will never attempt, and which defeats themaximumScale: 5setting anyway since they start from 0.π§ͺ Steps to Reproduce
/,/quiz,/sem4/os/ch1, etc.)initialScale: 1β the page renders normally at readable sizeβ Fix
One character change in
app/layout.tsx:This is the correct, universally-used value per the MDN viewport docs and Next.js viewport documentation.
π Impact
π References
π·οΈ Suggested Labels
bugΒ·frontendΒ·mobileΒ·criticalΒ·gssocΒ·level1