Skip to content

bug(0.18): catch-all routes silently return null from getEmDashEntry - 'route cache overwritten' warning #1446

Description

@Vallhalen

Summary

After upgrading from 0.16.10.18.0, all CMS-driven pages served via catch-all routes (src/pages/[slug].astro, src/pages/en/[slug].astro) silently return null from getEmDashEntry, causing them to fall through to a 404 / redirect. Pages with dedicated .astro files (e.g. regulamin.astro) continue to work fine.

Reproduced twice with deploy → rollback → re-deploy cycle (versions f3ce6777 and 5d84583b). Same affected pages, same warning in wrangler tail. Same site, same content - only the EmDash version differs.

Repro

  1. Site uses two catch-all routes that resolve CMS entries via getEmDashEntry:
  • src/pages/[slug].astro - Polish (default locale)
  • src/pages/en/[slug].astro - English (locale en)
  1. Upgrade emdash, @emdash-cms/cloudflare, @emdash-cms/admin from 0.16.1 to 0.18.0 (cloudflare adapter, D1).
  2. npm run build && wrangler deploy.
  3. Hit any CMS-driven page (e.g. /konsultacje, /en/terms).

Result: getEmDashEntry("pages", "konsultacje") returns { entry: null }. Rendered routes fall through to Astro.redirect("/404") (302) or Astro.rewrite("/404") (404).

Warning observed via wrangler tail --format pretty

Every request to an affected page logs:

[WARN] Internal Warning: route cache overwritten. (/[slug]_src/pages/[slug].astro)
[WARN] Internal Warning: route cache overwritten. (/en/[slug]_src/pages/en/[slug].astro)
[WARN] [cache] `cache.set()` was called but caching is not enabled.
 Configure a cache provider in your Astro config under `experimental.cache` to enable caching.

The (.../path/file.astro) suffix is unusual - the leading / and missing separator before _src suggest some kind of internal cache-key derivation that's clobbering itself. Both PL and EN catch-alls produce the warning, and both are affected.

Working vs broken in production

Site: chcedointernetu.pl (long-migrated EmDash instance, 0.5 → … → 0.16.1 chain).

URL Type 0.16.1 0.18.0
/ (home) hardcoded index.astro 200 200 ✅
/regulamin, /polityka-prywatnosci, /polityka-cookies, /dostepnosc hardcoded .astro files 200 200 ✅
/blog, /portfolio, /uslugi listing pages 200 200 ✅
/konsultacje CMS via [slug].astro 200 302 → /404
/deklaracja-etycznego-wykorzystania-ai CMS via [slug].astro 200 302 → /404
/en/consultations, /en/terms, /en/privacy-policy, /en/cookie-policy, /en/ai-ethics, /en/accessibility CMS via en/[slug].astro 200 404

So: hardcoded routes - fine. Catch-alls calling getEmDashEntry - broken.

The same SQL row exists in D1 and is returned correctly by both the REST API (/_emdash/api/content/pages/konsultacje?locale=pl) and raw wrangler d1 execute - so it's not a data issue. Something in the catch-all getEmDashEntry path is hitting the broken code path post-0.17.

Background - same regression on 0.17

We hit a narrower version of this on 0.17.2 back on 2026-06-07 - at that point only 4 pages were affected, all CMS-driven, all on these same catch-all routes. Hardcoded .astro pages worked then too.

After upgrading to 0.18.0 the regression expanded: 9 pages affected instead of 4 (every CMS page hit via the catch-alls, including all 6 EN translations refreshed yesterday via MCP). Nothing in our setup changed between the two attempts other than the EmDash version.

The fresh-install repro attempt we did on 0.17.2 did not trigger the bug - only this long-migrated production instance does. So the trigger likely sits at the intersection of (catch-all getEmDashEntry + accumulated migration state). The "route cache overwritten" warning landing on exactly these routes feels like the closest signal we've had yet.

Environment

  • emdash@0.18.0, @emdash-cms/cloudflare@0.18.0, @emdash-cms/admin@0.18.0
  • astro@6.4.x on Node 22, deployed to Cloudflare Workers
  • D1 binding (session: "auto"), R2 binding
  • Custom plugins: formsPlugin, backupPlugin, cookiesPlugin, inactiveTabTitle
  • mcp: true
  • Site has been continuously migrated since EmDash 0.5

What I'd love to know

  1. Is the route cache overwritten warning a known signal from 0.18's startup-concurrency changes (perf(core): emit stream-end metrics to expose post-header query cost #1407 / perf(core): parallelize cold-boot init phases and batch exclusive-hook reads #1408) or query-batching changes (perf(core): fix query waterfalls — getTerm parallelism, hydrated terms reuse, menu pattern caching #1409)?
  2. Is there a way to disable the internal cache that triggers this - experimental.cache config hint suggests there might be a knob?
  3. Does the catch-all getEmDashEntry path go through a different code branch in 0.18 that I should be aware of?

Happy to provide more diagnostics - wrangler tail JSON, schema dumps, anything. Rolled back to 0.16.1 again in the meantime.

Tagging earlier related thread: was about to revisit the 0.17 ticket but the 0.18 expansion seems like the cleaner repro to start from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions