Skip to content

fix: lazily load @parcel/watcher in @tailwindcss/cli#20340

Closed
deepshekhardas wants to merge 4 commits into
tailwindlabs:mainfrom
deepshekhardas:fix/lazy-load-parcel-watcher
Closed

fix: lazily load @parcel/watcher in @tailwindcss/cli#20340
deepshekhardas wants to merge 4 commits into
tailwindlabs:mainfrom
deepshekhardas:fix/lazy-load-parcel-watcher

Conversation

@deepshekhardas

Copy link
Copy Markdown

Cherry-pick of PR #20325

We weren't taking the `err.cause` into account, which could include
useful information.
@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The change is safe to merge. It only affects module loading order and error formatting; no build logic, CSS compilation, or watcher behaviour is altered.

The lazy-load refactor is a targeted, low-risk change: a static top-level import becomes a dynamic import wrapped in a try/catch with a clear user-facing error. The formatError consolidation removes duplicated inline code with correct cycle detection. The wordWrap fix addresses a cosmetic edge case without touching any logic paths that matter for compilation output.

No files require special attention.

Reviews (1): Last reviewed commit: "update CHANGELOG" | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1f1417a1-ffbe-4b36-ac37-602f86b95f3f

📥 Commits

Reviewing files that changed from the base of the PR and between bdcd708 and 432274d.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • packages/@tailwindcss-cli/src/commands/build/index.ts
  • packages/@tailwindcss-cli/src/utils/renderer.ts

Walkthrough

The CLI build command now formats errors with wrapped output and recursive cause handling. Watcher loading moved from module initialization to a dynamic import performed before watch-mode setup, with failures reported through the CLI error path. Watch and polling rebuild handlers use the shared formatter. Renderer word wrapping avoids creating an empty line before an oversized word. The unreleased changelog records the watcher-loading fix.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: lazy-loading @parcel/watcher in the CLI.
Description check ✅ Passed The description is related because it says this change is a cherry-pick of the matching PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix/lazy-load-parcel-watcher

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants