Skip to content

[Turbopack | CSS]: CSS prioritization differs between next dev --turbopack and next build --turbopack #86459

@SashaPolyanski

Description

@SashaPolyanski

Link to the code that reproduces this issue

https://github.com/SashaPolyanski/next-turbopack-style

To Reproduce

Use route my project with problem: http://localhost:3000/intensive or https://next-turbopack-style-edr3.vercel.app/intensive

To Reproduce

  1. Run the app in development with next dev --turbopack
    → Styles load correctly, no issues observed.

  2. Build the app with next build --turbopack and then start with next start
    → Styles are applied in a different priority/order compared to dev mode.

Notes:

  • The issue reproduces 100% on our current setup.
  • Sometimes deleting the pages folder or a random component in entities makes the bug disappear, which makes the behavior unpredictable.

Current vs. Expected behavior

  • Current: In production (next build --turbopack + next start), CSS order/priority differs from development, breaking the layout.
  • Expected: Style prioritization should be consistent between dev and build modes when using Turbopack.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0
Binaries:
  Node: 20.9.0
  npm: 10.8.2
Relevant Packages:
  next: 15.6.0-canary.12
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Turbopack

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

Happens locally with next build --turbopack → next start.
Cannot reproduce when running next dev --turbopack.
Issue sometimes disappears after removing a random folder/component, which suggests non-deterministic style bundling.

1 image - next dev --turbopack
2 image next build --turbopack → next start

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    TurbopackRelated to Turbopack with Next.js.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions