fix: Upgrade tailwindcss to 3.4.17 to fix Node.js 22.12+ compatibility #5238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades tailwindcss from 3.4.4 to 3.4.17 to fix a critical build error that occurs with Node.js 22.12+ and 23.x:
Root Cause Analysis
The Bug Chain
Node.js 22.12 introduced native
require(esm)supportmodule: unflag --experimental-require-module nodejs/node#55085
Our commit 7d6e252 triggered the issue by changing:
The exact failure path in our codebase:
require('./tailwind.config.js')require(esm)customIconCollection.tswhich usesimport.meta.url(ESM-only)require.cacheCache poisoning causes the actual error:
require.cacheand finds the poisoned entries@iconify/tailwindmodule is returned as{}instead of the actual moduleaddDynamicIconSelectors({})tries to call an empty objectThe Fix
Tailwind CSS 3.4.17 includes a workaround that forces jiti to always handle config loading, completely bypassing Node's problematic
require(esm)attempt. This prevents the cache poisoning issue entirely.Related Issues & PRs
require(esm)call fails unjs/jiti#346 - Cache poisoning bug in jitiImpact
This upgrade is required for compatibility with:
Without this fix, the build fails completely when using Tailwind plugins with these Node versions.
┆Issue is synchronized with this Notion page by Unito