Workers SDK Issue Reports

← Back to Dashboard

#2046 Inconsistent behaviour in _routes.json

Recommendation:KEEP OPEN
Difficulty:medium
Reasoning:

Partial fix in 2022 but issues remain. Latest comment (Mar 2024) reports excludes still not respected.

Suggested Action:

Verify current behavior with wrangler 4.x

Analysis Report

Issue Review: cloudflare/workers-sdk#2046

Summary

_routes.json has inconsistent behavior where excluding / causes all paths to be excluded, and there's no reliable way to reference the root index file.

Findings

  • Created: 2022-10-18
  • Updated: 2025-10-30
  • Version: wrangler 2.1.12 → 4.61.0
  • Component: pages
  • Labels: bug, pages
  • Comments: 8

Key Evidence

  • Using "include": ["/*"], "exclude": ["/"] results in all paths being excluded
  • Maintainer @CarmenPopoviciu confirmed bug in wrangler pages dev (Oct 2022)
  • A fix was pushed for wrangler pages dev (wrangler 2.x, Nov 2022)
  • However, reporter confirmed that even after fix, / or /index.html don't catch requests to the root URL
  • Latest commenter (Mar 2024) reports _routes.json still not being respected in wrangler pages dev
  • Issue is over 3 years old with partial fix but remaining problems

Recommendation

Status: KEEP OPEN

Reasoning: The original bug was partially fixed but problems remain. The latest comment from Mar 2024 indicates _routes.json exclude rules still don't work properly in wrangler pages dev. The issue of referencing the root index file also appears unresolved.

Action: Investigate current behavior of _routes.json exclude rules in wrangler pages dev with wrangler 4.x to determine if issues persist.

Suggested Comment

This issue has been open for over 3 years with a partial fix applied in late 2022. Can anyone verify if the remaining issues (exclude rules not being respected, root index file matching) still occur with wrangler 4.x? If the issues persist, please provide a minimal reproduction with the current wrangler version.

Notes & Feedback (0)

No notes yet.

Add Note