Skip to content

fix: router.handle -> router.fetch for itty-router v5#14

Open
chitcommit wants to merge 1 commit intomainfrom
fix/itty-router-v5-compat
Open

fix: router.handle -> router.fetch for itty-router v5#14
chitcommit wants to merge 1 commit intomainfrom
fix/itty-router-v5-compat

Conversation

@chitcommit
Copy link
Copy Markdown
Contributor

@chitcommit chitcommit commented Mar 28, 2026

Summary

  • router.handle() does not exist in itty-router v5 — it was renamed to router.fetch()
  • The old call hit the Proxy getter, created a phantom route, returned undefined, causing Worker to hang (1101)
  • Switched from custom_domain to zone route to avoid routing conflicts

Already deployed

Fix is live on intel.chitty.cc — health check returning 200.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Summary by CodeRabbit

  • Chores
    • Updated internal request handling method call.
    • Modified production route configuration for improved request pattern matching and zone management.

itty-router v5 renamed the dispatch method from handle() to fetch().
The old call hit the Proxy getter, created a phantom route entry,
and returned undefined — causing the Worker to hang with 1101.

Also switched from custom_domain to zone route to avoid routing
conflicts (the custom domain + legacy route combo caused loops).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
chittyintel 6477e09 Mar 28 2026, 10:14 AM

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 16cc22e0-f1fc-471e-a421-9f655448a1ff

📥 Commits

Reviewing files that changed from the base of the PR and between 1a59236 and 6477e09.

📒 Files selected for processing (2)
  • src/index.js
  • wrangler.toml

📝 Walkthrough

Walkthrough

The request handling in the main entry point switches from calling router.handle() to router.fetch() for routing logic. The production route configuration is updated from a domain-level custom domain pattern to a wildcard path pattern with explicit zone association.

Changes

Cohort / File(s) Summary
Request Handler
src/index.js
Internal method call updated from router.handle(request, env, ctx) to router.fetch(request, env, ctx) for obtaining routed results.
Route Configuration
wrangler.toml
Production routes entry modified from domain-level custom domain intel.chitty.cc to wildcard path intel.chitty.cc/* with explicit zone_name = "chitty.cc" assignment.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A method hops from handle to fetch so spry,
Routes now dance with asterisks across the sky,
Zone names whisper where domains once stood tall,
Little changes, graceful hops—we love them all! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately reflects the main changes: updating the router method call from handle() to fetch() for itty-router v5 compatibility, which is the primary code change in src/index.js.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/itty-router-v5-compat

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 and usage tips.

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.

1 participant