-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Description
What version of Tailwind CSS are you using?
tailwindcss@4.2.1@tailwindcss/postcss@4.2.1
(Also seen in 4.1.x in my project)
What build tool (or framework) are you using?
PostCSS (minimal reproduction), also reproducible in Vite + @tailwindcss/postcss
What version of Node.js are you using?
v25.4.0
What browser are you using?
N/A (build-time crash)
What operating system are you using?
macOS (Apple Silicon)
Describe your issue
Tailwind v4 crashes during CSS build if a scanned source file contains the plain string:
row-constructor
This is not an actual class used in HTML/JSX, just a string in source code (e.g. a test title / log message).
The crash is:
V.map is not a function
It appears Tailwind parses row-constructor as the row-* utility with candidate value constructor, then hits a prototype property (constructor) instead of an own static value entry and crashes.
Actual behavior
Build fails with an error like:
tailwindcss: .../app.css:1:1: V.map is not a function
TypeError: V.map is not a function
Expected behavior
Tailwind should ignore unsupported/invalid candidate values safely and not crash.
Minimal reproduction
1) Create a minimal project
mkdir tw-row-constructor-repro
cd tw-row-constructor-repro
npm init -y
npm i -D tailwindcss@4.2.1 @tailwindcss/postcss@4.2.1 postcss
mkdir src
2) Add a scanned source file containing the string row-constructor
test.ts
const label = 'row-constructor'
console.log(label)
3) Add Tailwind CSS entry with explicit source scanning (v4 style)
app.css
@import "tailwindcss" source(none);
@source "./src";
4) Run PostCSS with @tailwindcss/postcss
node -e "import postcss from 'postcss'; import tw from '@tailwindcss/postcss'; import fs from 'fs'; postcss([tw()]).process(fs.readFileSync('app.css','utf8'),{from:process.cwd()+'/app.css'}).then(()=>console.log('PASS')).catch(e=>{console.error(e); process.exit(1);});"
5) Result
Build crashes with:
TypeError: V.map is not a function
...
tailwindcss: .../app.css:1:1: V.map is not a function
Why I think this is a Tailwind bug (not app code)
The trigger is a plain string literal in scanned source.
Removing or changing row-constructor avoids the crash.
Restricting Tailwind scan sources to exclude that file works as a workaround.
This reproduces in a minimal project (no framework-specific code required).
Workarounds (for others)
Avoid scanning non-frontend/test source files
Restrict v4 scan sources with @source
Rename the string (e.g. row constructor) to avoid row-constructor
Suspected cause (optional hint)
This looks like a prototype lookup issue when resolving a static value for the row utility:
candidate value becomes constructor
lookup returns Object.prototype.constructor (a function)
Tailwind then calls .map(...) on it
If helpful, I can provide a patched local debug trace that showed the candidate value was constructor.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels