Repository navigation
Conversation
…ut its mtime is unchanged
[Medium impact] The PR appears safe to merge; no actionable issues were found. Reviews (1) · Last reviewed commit: "Add changelog entry" · Reviewed by Greptile |
|
Thanks for the PR, and for the great investigation in the issue! You found the cause and the right fix. We closed this PR in favor of #20582, which uses the same Sent by an AI assistant on behalf of @RobinMalfait. |
|
Thanks for the quick fix and the explanation. |
Summary
Fixes #20581
The
@tailwindcss/turbopackloader decides between an incremental and a full rebuild by comparing mtimes only. Turbopack can run the loader with the previous source after the input file's mtime has already changed, and then again with the current source. The first call rebuilds the compiler from the stale source and records the new mtime, so the second call sees an unchanged mtime and reuses that stale compiler. As a result,next devkeeps serving the CSS from one revision before the latest edit.This is the same "one revision behind" symptom that was fixed for
@tailwindcss/postcssin #17554, and@tailwindcss/postcsshas also compared the input CSS with the previous compile since #20310. This PR adds the same inputCss check to the Turbopack loader, which was ported from the webpack loader and lacks this check.Test plan
Added an integration test that edits the input CSS file during
next devand checks that the served CSS reflects each edit.Without the fix, the new test fails because the served CSS still contains the previous edit:
With the fix, both Turbopack tests pass: