Skip to content

fix(deps): bump catalog to @astrojs/cloudflare 13.5.3 + @astrojs/node 10.1.1#1116

Merged
ascorbic merged 6 commits into
mainfrom
fix/cloudflare-adapter-pin-13.5.1
May 20, 2026
Merged

fix(deps): bump catalog to @astrojs/cloudflare 13.5.3 + @astrojs/node 10.1.1#1116
ascorbic merged 6 commits into
mainfrom
fix/cloudflare-adapter-pin-13.5.1

Conversation

@ascorbic
Copy link
Copy Markdown
Collaborator

@ascorbic ascorbic commented May 20, 2026

What does this PR do?

Catalog bumps + workspace fixes so freshly scaffolded sites (and the workspace itself) install a working combination of @astrojs/cloudflare, astro, and @astrojs/node.

Closes #

Problem: Sites scaffolded with create-emdash were installing @astrojs/cloudflare@13.5.2 (the catalog's ^13.1.7 floats to the latest) and 500ing on every request:

[ERROR] [vite] Internal server error: Astro is not defined
    at runInRunnerObject (workers/runner-worker/index.js:107:3)
    at _NonRunnablePipeline.getComponentByRoute (.../astro_app_entrypoint_dev.js)

Two distinct bugs in @astrojs/cloudflare 13.5.x converged:

  1. 13.5.0+ depends on Astro 6.3.0 and exposes a dep-discovery cascade-reload. Vite re-optimizes every time it discovers a new subpath export (e.g. emdash/middleware/redirect, @emdash-cms/cloudflare/storage/r2), the runner-worker holds the previous bundle hash, and the first request lands on a chunk that doesn't exist yet. Surfaces as Astro is not defined or chunk-XXX.js does not exist.
  2. 13.5.2 added astroFrontmatterScanPlugin (withastro/astro#16708) which routed every .astro import through esbuild. esbuild can't resolve Vite virtual modules, so any .astro component that does await import("virtual:…") (astro-iconset, astro-expressive-code, …) crashed the pre-bundle.

Upstream has now shipped withastro/astro#16801 (released as @astrojs/cloudflare@13.5.3 + astro@6.3.6), which reverts #16708. Combined with the dep-resolution work in 13.5.1, the combo is now stable.

Changes

pnpm-workspace.yaml catalog:

  • @astrojs/cloudflare: ^13.1.7^13.5.3 (picks up the upstream revert; unpinned so future fixes flow in).
  • astro: ^6.0.1^6.3.0 (required by 13.5.3's peerDependencies.astro).
  • @astrojs/node: ^10.0.0^10.1.1. 10.0.0 calls app.getAdapterLogger() which doesn't exist on the Astro v6.3 App class, breaking every Node-adapter consumer in the workspace (including fixtures/perf-site, used by the query-counts CI workflow). 10.1.1 updates to the v6 Adapter API.

pnpm-workspace.yaml cooldown:

  • astro and @astrojs/cloudflare are temporarily exempted from minimumReleaseAge so this PR can install the fix versions that are still inside the 24h supply-chain cooldown. The exclusions should be removed once the cooldown passes.

demos/playground/wrangler.jsonc:

  • Declares the SESSION KV binding (emdash-playground-session) explicitly under both the top-level kv_namespaces and previews.kv_namespaces. From 13.2.0 onwards, the adapter injects the auto-provisioned SESSION binding into previews.kv_namespaces with no id. wrangler ... preview (used by Workers Builds on non-main branches for try.emdashcms.com) reads previews.kv_namespaces and forwards namespace_id verbatim — unlike wrangler deploy, it has no provisionBindings step, so a binding without id fails the deploy with API error 10021. Declaring the id explicitly satisfies both paths.

Verified

  • demos/cloudflare dev (pnpm dev) — was failing with the cascade-reload error on a clean install; now serves /, /posts, /category/development, /rss.xml, /_emdash/admin as 200/302.
  • demos/cloudflare build (astro build) — clean.
  • fixtures/perf-site (Node adapter) — was failing with TypeError: app.getAdapterLogger is not a function; now boots, query-counts harness completes.
  • try.emdashcms.com Workers Builds preview deploy — was failing with binding SESSION of type kv_namespace must have a namespace_id specified [code: 10021]; the playground wrangler.jsonc fix unblocks it.

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main.
  • I have added a changeset (if this PR changes a published package) — N/A, the catalog is workspace-only; templates aren't published as an npm package
  • New features link to an approved Discussion: N/A — bug fix

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Opus 4.7

13.5.2 introduced an astroFrontmatterScanPlugin that breaks any
`virtual:*` module import inside .astro frontmatter (e.g. astro-iconset,
astro-expressive-code). 13.5.0/13.5.1 also expose a cascade-reload bug
in workerd that surfaces as "Astro is not defined" or
"chunk-XXX.js does not exist" on the first request after a clean cache,
unless every transitive dep is pre-bundled.

13.5.1 escapes both: no frontmatter scan, and its dep-resolution fixes
keep the cascade quiet for the deps emdash actually uses. Pinning the
catalog to exact `13.5.1` (no caret) propagates to all four
`templates/*-cloudflare/package.json` files via the catalog sync, so
`create-emdash` scaffolded sites install a known-good combination.

13.5.1 declares peerDependencies.astro: ^6.3.0, so bump the catalog
astro range to ^6.3.0 to satisfy it.

Add a picomatch override to ^4.0.4 so the workspace's transitive
graph dedups to a single version. Without it, `@rollup/pluginutils`
pulls picomatch@4.0.3 on a sibling path that the adapter's
`astro > picomatch` pre-bundle doesn't cover, and workerd hits raw
CJS at module load. End-user installs happened to dedup correctly,
but local dev in this repo did not.
Copilot AI review requested due to automatic review settings May 20, 2026 07:22
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

⚠️ No Changeset found

Latest commit: cc92cc0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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

cloudflare-workers-and-pages Bot commented May 20, 2026

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
emdash-perf-coordinator cc92cc0 May 20 2026, 02:12 PM

@github-actions
Copy link
Copy Markdown
Contributor

Scope check

This PR changes 530 lines across 2 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

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

cloudflare-workers-and-pages Bot commented May 20, 2026

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
emdash-i18n cc92cc0 May 20 2026, 02:12 PM

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

cloudflare-workers-and-pages Bot commented May 20, 2026

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
docs cc92cc0 May 20 2026, 02:12 PM

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

cloudflare-workers-and-pages Bot commented May 20, 2026

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
emdash-playground cc92cc0 May 20 2026, 02:13 PM

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

cloudflare-workers-and-pages Bot commented May 20, 2026

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
emdash-demo-cache cc92cc0 May 20 2026, 02:13 PM

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 20, 2026

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@1116

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@1116

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@1116

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@1116

emdash

npm i https://pkg.pr.new/emdash@1116

create-emdash

npm i https://pkg.pr.new/create-emdash@1116

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@1116

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@1116

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@1116

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@1116

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@1116

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@1116

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@1116

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@1116

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@1116

commit: cc92cc0

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Pins the Astro Cloudflare adapter version used by scaffolded Cloudflare templates to a known-good release to avoid runtime 500s/regressions introduced in newer adapter versions, and aligns workspace dependencies accordingly.

Changes:

  • Pin @astrojs/cloudflare in the workspace catalog to 13.5.1 (exact).
  • Bump astro catalog range to ^6.3.0 to satisfy adapter peer requirements.
  • Add a workspace-level picomatch override and refresh pnpm-lock.yaml to match the new resolution graph.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
pnpm-workspace.yaml Pins @astrojs/cloudflare to 13.5.1, bumps astro, and adds a picomatch override.
pnpm-lock.yaml Updates lockfile to reflect the new catalog pins/overrides and resulting dependency graph.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pnpm-workspace.yaml Outdated
Comment on lines +40 to +43
# ssr.optimizeDeps.include. Sibling resolution paths (rollup/pluginutils,
# tinyglobby, fdir) keep raw CJS picomatch that workerd can't load.
# Force a single 4.0.4 so the pre-bundle covers every consumer.
picomatch: "^4.0.4"
ascorbic and others added 4 commits May 20, 2026 10:22
@astrojs/cloudflare 13.2+ writes the auto-provisioned SESSION binding
into both the top-level config and previews.kv_namespaces of the built
wrangler.json, but with no id field. wrangler preview reads from
previews.kv_namespaces and forwards namespace_id verbatim; unlike
wrangler deploy it has no provisionBindings path. The API rejects the
binding-without-id with error 10021.

Declare the SESSION KV id explicitly in the playground's wrangler.jsonc
at both locations so the adapter's customizer skips re-injecting and
the user-supplied id propagates to both. Uses the existing
emdash-playground-session namespace already bound to the production
worker.
@astrojs/node@10.0.0 calls app.getAdapterLogger() at server start,
which doesn't exist on the new Astro v6 App class. Crashes any node
adapter consumer (including fixtures/perf-site, used by the query-
counts CI workflow):

  TypeError: app.getAdapterLogger is not a function
      at createAppHandler
      at createStandaloneHandler

@astrojs/node@10.1.1 updates to the v6 Adapter API. The astro@^6.3.0
catalog bump that #1116 introduced (required by @astrojs/cloudflare
13.5.1) made this surface.
@github-actions github-actions Bot added the query-count changed PR diff modifies query-count snapshot files label May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Query-count snapshot changes

28 routes changed, total Δ -165 queries.

SQLite

Route Before After Δ
GET / (cold) 11 6 -5
GET / (warm) 11 6 -5
GET /category/development (cold) 15 10 -5
GET /category/development (warm) 14 9 -5
GET /pages/about (cold) 10 5 -5
GET /pages/about (warm) 10 5 -5
GET /posts (cold) 11 6 -5
GET /posts (warm) 11 6 -5
GET /posts/building-for-the-long-term (cold) 23 17 -6
GET /posts/building-for-the-long-term (warm) 23 17 -6
GET /search (cold) 12 6 -6
GET /search (warm) 12 6 -6
GET /tag/webdev (cold) 14 9 -5
GET /tag/webdev (warm) 14 9 -5

D1

Route Before After Δ
GET / (cold) 21 15 -6
GET / (warm) 11 5 -6
GET /category/development (cold) 25 18 -7
GET /category/development (warm) 14 8 -6
GET /pages/about (cold) 20 13 -7
GET /pages/about (warm) 10 4 -6
GET /posts (cold) 21 14 -7
GET /posts (warm) 11 5 -6
GET /posts/building-for-the-long-term (cold) 32 26 -6
GET /posts/building-for-the-long-term (warm) 22 16 -6
GET /search (cold) 22 14 -8
GET /search (warm) 12 5 -7
GET /tag/webdev (cold) 25 18 -7
GET /tag/webdev (warm) 14 8 -6

Comparing snapshot files between base and head. Updated automatically on each push.

Replaces the exact 13.5.1 pin with ^13.5.3, the upstream-shipped fix
(withastro/astro#16801) that reverts the broken esbuild scan plugin
from 13.5.2.

The picomatch override is also no longer needed. The override was
defending against a workspace-only dual-resolve (picomatch@4.0.3 and
@4.0.4 both installed). With the catalog now on @cloudflare/vite-plugin
^1.36.3 and @astrojs/cloudflare 13.5.3, transitive consumers dedup
cleanly to a single 4.0.4 and the workerd dev runtime no longer hits
the unbundled CJS path.

Temporarily exempts astro and @astrojs/cloudflare from
minimumReleaseAge so the catalog can pick up the fix versions that are
still inside the 24h supply-chain cooldown. The exclusions should be
removed once the cooldown passes.
@ascorbic ascorbic changed the title fix(templates): pin @astrojs/cloudflare to 13.5.1 fix(deps): bump catalog to @astrojs/cloudflare 13.5.3 + @astrojs/node 10.1.1 May 20, 2026
@ascorbic
Copy link
Copy Markdown
Collaborator Author

I think the query counts are an artifact of changes to how frontmatter is evaluated meaning we're missing some queries in our tests. I don't think it's a real reduction. We'll update with a fix to the test tooling.

@ascorbic ascorbic merged commit 4f49c20 into main May 20, 2026
42 checks passed
@ascorbic ascorbic deleted the fix/cloudflare-adapter-pin-13.5.1 branch May 20, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: signed query-count changed PR diff modifies query-count snapshot files size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants