Skip to content

Fix production FOUC caused by manifest key mismatch#1084

Merged
justinvdm merged 3 commits intomainfrom
investigate-fouc
Mar 15, 2026
Merged

Fix production FOUC caused by manifest key mismatch#1084
justinvdm merged 3 commits intomainfrom
investigate-fouc

Conversation

@justinvdm
Copy link
Copy Markdown
Collaborator

@justinvdm justinvdm commented Mar 15, 2026

Problem

Production builds had a Flash of Unstyled Content (FOUC). Our module IDs use a leading slash while Vite's manifest keys do not, so stylesheet and preload lookups silently found nothing. No CSS links were included in the server-rendered HTML.

Solution

We normalize module IDs to match the manifest key format before lookup. We also added a CSS e2e test that verifies the production HTML includes stylesheet links by loading the page with JavaScript disabled.

Fixes #1083

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying redwood-sdk-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6629258
Status: ✅  Deploy successful!
Preview URL: https://bf642060.redwood-sdk-docs.pages.dev
Branch Preview URL: https://investigate-fouc.redwood-sdk-docs.pages.dev

View logs

@justinvdm justinvdm marked this pull request as ready for review March 15, 2026 19:58
@justinvdm justinvdm merged commit 2a5802f into main Mar 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FOUC in Starter Template

1 participant