next.js
next.js copied to clipboard
fix: ensure consistent CSS ordering between dev and build with Turbopack
Fixes #86704
Problem
CSS prioritization differs between next dev --turbopack and next build --turbopack, causing layout breakage in production builds. Styles that load correctly in development mode are applied in a different order in production, breaking the visual appearance.
Root Cause
In flight-manifest-plugin.ts:297-318, CSS files are collected from webpack entrypoints using:
manifest.entryCSSFiles[chunkEntryName] = entrypoint
.getFiles()
.filter((f) => !f.startsWith('static/css/pages/') && f.endsWith('.css'))
.map((file) => { /* ... */ })
Allow CI Workflow Run
- [ ] approve CI run for commit: 8637bf423d4d80dc862f9d891e0ef99af889d907
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer
Allow CI Workflow Run
- [ ] approve CI run for commit: 6ab4f8babf50b6053f087d60b51e532de36fca29
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer