next.js icon indicating copy to clipboard operation
next.js copied to clipboard

fix: ensure consistent CSS ordering between dev and build with Turbopack

Open harshcoder-harsh opened this issue 1 month ago • 2 comments

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) => { /* ... */ })

harshcoder-harsh avatar Dec 03 '25 17:12 harshcoder-harsh

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

ijjk avatar Dec 03 '25 17:12 ijjk

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

ijjk avatar Dec 03 '25 17:12 ijjk