Skip to content

fix(cloudflare): read unquoted TOML compatibility_date as a string - #50

Open
tlq5l wants to merge 1 commit into
nitrojs:mainfrom
tlq5l:fix/cloudflare-toml-compat-date-29
Open

tlq5l wants to merge 1 commit into
nitrojs:mainfrom
tlq5l:fix/cloudflare-toml-compat-date-29

Conversation

@tlq5l

@tlq5l tlq5l commented Nov 24, 2026

Copy link
Copy Markdown

🔗 Linked issue

Resolves #29

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

With an unquoted compatibility_date = 2026-09-01 in wrangler.toml, node compat is now inferred from the date, and nodejs_compat is added for dates before 2026-08-04. TOML parses the unquoted value as a Date, so both comparisons with "2026-08-04" were false. readWranglerConfig now turns a date-only Date value into its YYYY-MM-DD string; other values are left as they are.

Tests (agent-run) at ebee69d, clean setup (empty HOME, no git config): corepack enable >/dev/null 2>&1 && pnpm install --frozen-lockfile >/dev/null 2>&1 && pnpm stub >/dev/null 2>&1 && pnpm vitest run test/unit/cloudflare-config.test.ts, exit 0.
Fails without fix: the same command on ebee69d, with the fix's code reverted to origin/main: exit 1, the two new unquoted-date cases fail.

AI disclosure: this PR was written with an AI coding agent; the test results above come from the agent's run on a clean checkout.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@tlq5l
tlq5l requested a review from pi0 as a code owner November 24, 2026 01:20
@vercel

vercel Bot commented Nov 24, 2026

Copy link
Copy Markdown

@tlq5l is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cc29498f-c429-4b3d-849e-8aca37b07da2
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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.

cloudflare: unquoted TOML compatibility_date is never compared correctly

1 participant