You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone https://github.com/coderrshyam/next.js-hook-webpack-error.git
cd next.js-hook-webpack-error
Install dependencies:
pnpm install
Attempt to build the project:
pnpm build
Issue Description:
When attempting to build a Next.js project with Tailwind CSS v4, an issue occurs with CSS selector parsing, specifically for selectors containing attribute selectors with empty string values.
The problematic selector: .prose code[data-theme*=" "]
Behavior in Tailwind CSS v3 (Working Correctly)
In Tailwind CSS v3, the selector is parsed correctly:
The parser in Tailwind CSS v4 should correctly handle the empty string in the attribute selector, similar to how it was handled in v3.
Actual Behavior
The parser in Tailwind CSS v4 seems to be escaping or misinterpreting the empty string in the attribute selector, leading to an incorrect parsing of the CSS rule.
Additional Notes
This issue specifically occurs during the build process of a Next.js project.
The problem appears to be isolated to cases where an attribute selector contains an empty string value.
The text was updated successfully, but these errors were encountered:
Hey! This seems like an issue in the upstream handling of the CSS file, I can reproduce this without Tailwind CSS. The reason is that we minify the selector you mentioned to something like this (in it's most minimal form):
Tailwind CSS v4 Selector Parsing Issue with Empty String Attribute
Environment
Reproduction
Repository: https://github.com/coderrshyam/next.js-hook-webpack-error
Steps to Reproduce:
git clone https://github.com/coderrshyam/next.js-hook-webpack-error.git cd next.js-hook-webpack-error
Issue Description:
When attempting to build a Next.js project with Tailwind CSS v4, an issue occurs with CSS selector parsing, specifically for selectors containing attribute selectors with empty string values.
The problematic selector:
.prose code[data-theme*=" "]
Behavior in Tailwind CSS v3 (Working Correctly)
In Tailwind CSS v3, the selector is parsed correctly:
Behavior in Tailwind CSS v4 (Incorrect)
In Tailwind CSS v4, the selector is not parsed correctly:
Expected Behavior
The parser in Tailwind CSS v4 should correctly handle the empty string in the attribute selector, similar to how it was handled in v3.
Actual Behavior
The parser in Tailwind CSS v4 seems to be escaping or misinterpreting the empty string in the attribute selector, leading to an incorrect parsing of the CSS rule.
Additional Notes
The text was updated successfully, but these errors were encountered: