Skip to content

chore(deps): upgrade to Astro 7, drop SSR prebundle workaround#85

Merged
kianandersson merged 4 commits into
mainfrom
chore/upgrade-astro-7-remove-16933-workaround
Jul 15, 2026
Merged

chore(deps): upgrade to Astro 7, drop SSR prebundle workaround#85
kianandersson merged 4 commits into
mainfrom
chore/upgrade-astro-7-remove-16933-workaround

Conversation

@kianandersson

Copy link
Copy Markdown
Owner

Why

Astro 7.0.5 (withastro/astro#17242) permanently fixes the Cloudflare adapter dep-optimizer race that we've been working around. It surfaced after a dev restart as a 500 referencing a missing prebundled chunk (withastro/astro#16933):

The file does not exist at node_modules/.vite/deps_ssr/…js which is in the optimize deps directory.

Our force-ssr-prebundle Vite plugin in astro.config.mjs forced a fresh SSR prebundle on every restart to sidestep that race. This PR removes it.

Why the major bump

The fix landed only on the 7.x line — it was not backported to 6.4.x. I verified locally that simply deleting the workaround on our current Astro 6.4.6 reproduces the exact error under astro check. So removing the workaround requires the upgrade:

  • astro 6.4.6 → 7.0.6 (Vite 8 / Rust compiler / Rolldown)
  • @astrojs/cloudflare 13.7.0 → 14.1.1
  • @astrojs/preact 5.1.5 → 6.0.1

Breaking-change review

None of the Astro 6→7 breaking changes apply here: no experimental flags in the config, no src/fetch.ts, no remark/rehype pipeline, and content collections use YAML loaders rather than Markdown (so the Sätteri default is irrelevant).

pnpm-workspace.yaml gains minimumReleaseAgeExclude entries for the new releases — pnpm added these so the fresh versions clear the supply-chain release-age gate.

The optimizeDeps.include list stays untouched; it addresses a separate issue (withastro/astro#16248), not this one.

Verification

All pass locally with the workaround removed:

  • pnpm build ✓ (incl. Storybook integration)
  • astro check ✓ — the previously-failing path
  • biome check
  • 200 unit/component tests ✓
  • bundle-size test ✓
  • 152 Playwright e2e tests ✓

🤖 Generated with Claude Code

Astro 7.0.5 (withastro/astro#17242) permanently fixes the Cloudflare
adapter dep-optimizer race that surfaced as a missing prebundled chunk
after a dev restart (withastro/astro#16933):

  The file does not exist at "node_modules/.vite/deps_ssr/…js" which is
  in the optimize deps directory.

Our `force-ssr-prebundle` Vite plugin forced a fresh SSR prebundle on
every restart to sidestep that race. The fix landed only on the 7.x
line (not backported to 6.4.x), so removing the workaround requires the
major bump:

- astro 6.4.6 → 7.0.6 (Vite 8 / Rust compiler / Rolldown)
- @astrojs/cloudflare 13.7.0 → 14.1.1
- @astrojs/preact 5.1.5 → 6.0.1

No app code changes needed: no experimental flags, no src/fetch.ts, no
remark/rehype pipeline, and content collections use YAML loaders rather
than Markdown, so none of the v7 breaking changes apply here.

The `optimizeDeps.include` list stays — it addresses a separate issue
(withastro/astro#16248), not this one.

Verified: build, astro check, biome, 200 unit/component tests, bundle
test, and 152 e2e tests all pass with the workaround removed.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
`astro check` under Astro 7 scanned the generated `coverage/` output
(e.g. the vendored `prettify.js` shipped in the v8 HTML report),
emitting a spurious ts(6133) warning. `coverage/` was the one generated
directory missing from the exclude list alongside dist, test-results,
and storybook-static. Excluding it drops the check surface to source
only (212 → 209 files) and clears the warning.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
pnpm added these to satisfy its ~24h minimumReleaseAge supply-chain gate
when the Astro 7 packages were freshly published (2026-07-02). The pins
are only needed while those exact versions sit inside the release-age
window; once they age past the threshold, `pnpm install --frozen-lockfile`
resolves them without the exclude and the list becomes a no-op.

Removing it keeps the workspace config clean. CI must be re-run after the
packages clear the 24h gate (~2026-07-03 19:27 UTC) for the frozen-lockfile
install to pass; the lockfile itself is unchanged.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Patch releases published since this branch was cut. Notably
@astrojs/cloudflare 14.1.2 now prebundles astro/components and the
<ClientRouter /> runtime in the dev server to prevent mid-session
optimizer reloads — the same area as the removed issue 16933 workaround,
which makes that removal more robust. astro 7.0.9 fixes client islands
failing to hydrate after a failed first load (this site uses client:load
/ client:visible islands), and 7.0.7-7.0.8 pick up dev-server and build
regression fixes plus a compiler update.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@kianandersson
kianandersson temporarily deployed to preview July 14, 2026 21:56 — with GitHub Actions Inactive
@kianandersson
kianandersson merged commit 4d62125 into main Jul 15, 2026
22 of 31 checks passed
@kianandersson
kianandersson deleted the chore/upgrade-astro-7-remove-16933-workaround branch July 15, 2026 15:59
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