Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Bug: CSS minification error in next.js@14.2.35 via CssMinimizerPlugin | GoodFirstPicks

Bug: CSS minification error in [email protected] via CssMinimizerPlugin

vercel/next.js 1 comments 13d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeTest focusedNext.jsTypeScriptReact

Why this is a good first issue

CSS minification issue in an outdated Next.js version with unclear reproduction steps.

AI Summary

The issue involves CSS minification errors in Next.js v14.2.35, specifically affecting production builds. The problem is partially reproduced through nextra-theme-docs, but maintainers request a direct reproduction. The outdated version complicates potential fixes.

Issue Description

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/quirky-panna-2m23xd

To Reproduce

This issue only persists in production builds (next build) and does not appear in development mode.

  1. Run pnpm build to bundle the application for production.
  2. Inspect the generated .css file in the .next/static/css/ directory.
  3. Search for classes like .x:max-xl:hidden or .x:max-lg:block

Current vs. Expected behavior

This project imports the nextra-theme-docs/style.css file in /app/layout.tsx. There are some styles in this style file (such as: .x:max-xl:hidden, .x:max-lg:block, etc.), but in the css file of the packaged file, the styles of these class names have changed.

Expected Behavior

Image

Actual Behavior

Image

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.12.0
  npm: 10.5.0
  Yarn: 1.22.19
  pnpm: 8.15.6
Relevant Packages:
  next: 14.2.35 // An outdated version detected (latest is 16.1.7), upgrade is highly recommended!
  eslint-config-next: 15.5.7
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.8.3
Next.js Config:
  output: export

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

CSS

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

next build (local)

Additional context

Currently, I have resolved this issue by manually overriding the built-in CssMinimizerPlugin in next.config.js and replacing it with a fresh instance of css-minimizer-webpack-plugin.

<img width="846" height="270" alt="Image" src="https://github.com/user-attachments/assets/0807b7ae-0720-4085-9d

GitHub Labels

CSS

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • outdated version
  • dependency on nextra
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedyes