Skip to content

Fix crash when using @tailwindcss/vite using deno v2.8.x#20245

Merged
RobinMalfait merged 2 commits into
mainfrom
fix/issue-20232
Jun 16, 2026
Merged

Fix crash when using @tailwindcss/vite using deno v2.8.x#20245
RobinMalfait merged 2 commits into
mainfrom
fix/issue-20232

Conversation

@RobinMalfait

@RobinMalfait RobinMalfait commented Jun 16, 2026

Copy link
Copy Markdown
Member

This PR might fix an issue where resolvers don't work on deno v2.8.x (they do work on deno v2.7.x) when using @tailwindcss/vite.

This happens when the context.parentURL is not actually a URL at all, and therefore the new URL(…) just crashes. This PR will fallback to the incoming result for files that are not passed proper URLs.

Fixes: #20232

Test plan

  1. Existing tests pass
  2. Can't seem to figure out how to test this in the reproduction issue without publishing first. So going to merge this and test the insiders version instead.
  3. Tested with the insiders build:

Deno v2.7:
image

Deno v2.8:
image

Deno v2.8 + @tailwindcss/vite@insiders:
image

@RobinMalfait RobinMalfait requested a review from a team as a code owner June 16, 2026 13:52
@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the change is a minimal, well-scoped defensive guard that cannot regress existing behavior.

The fix wraps a two-line URL construction block in a try/catch and falls back to returning the unmodified resolver result on any exception. Every existing code path that succeeded before still succeeds; only the previously-crashing path now recovers gracefully. No logic is removed or reordered.

No files require special attention.

Reviews (2): Last reviewed commit: "update changelog" | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jun 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: 6c381af0-99a1-4716-a636-12c700af08c2

📥 Commits

Reviewing files that changed from the base of the PR and between 127d170 and de22f4a.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • packages/@tailwindcss-node/src/esm-cache.loader.mts

Walkthrough

The processResolve function in packages/@tailwindcss-node/src/esm-cache.loader.mts now wraps its URL rewriting logic—reading context.parentURL, manipulating search params, and constructing the return URL—in a try/catch block. On any exception, it returns the original unmodified result rather than propagating the error. The CHANGELOG.md adds a corresponding entry under [Unreleased] → Fixed noting that @tailwindcss/vite no longer crashes in Deno v2.8.x when context.parentURL is not a valid URL.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main fix: addressing a crash in @tailwindcss/vite when using Deno v2.8.x.
Description check ✅ Passed The description explains the problem, solution, and references the linked issue #20232, providing context for the crash fix in @tailwindcss/vite under Deno.
Linked Issues check ✅ Passed The code changes implement the required fix by wrapping URL parsing logic in try/catch to handle cases where context.parentURL is not a valid URL, directly addressing the regression in issue #20232.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the crash: CHANGELOG.md documents the fix and esm-cache.loader.mts implements the fallback mechanism for invalid URLs.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@RobinMalfait RobinMalfait merged commit 51f0760 into main Jun 16, 2026
9 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-20232 branch June 16, 2026 14:03
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.

@tailwindcss/vite 4.3.1 breaks Vite tsconfig extends resolution under Deno

1 participant