Skip to content

[pull] main from withastro:main - #674

Merged
pull[bot] merged 7 commits into
code:mainfrom
withastro:main
Aug 7, 2026
Merged

[pull] main from withastro:main#674
pull[bot] merged 7 commits into
code:mainfrom
withastro:main

Conversation

@pull

@pull pull Bot commented Aug 7, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

ashleigh-yeoman and others added 7 commits August 7, 2026 11:03
Merged PR that was missing this case: #17605
Co-authored-by: Matthew Phillips <matthewphillips@cloudflare.com>
…renderEnvironment: 'node' (#17349)

* fix: skip non-prerendered route imports in prerender handler to avoid cloudflare:workers error

When `prerenderOnly` is true, `matchRoute` now skips routes with `prerender: false`
before importing their components. This prevents the Node prerender environment from
trying to import modules that use runtime-specific APIs (e.g. `cloudflare:workers`)
which are unavailable in Node.

Fixes #17348

* chore: remove stray triage/repro-17348 importer from pnpm-lock.yaml

The importer was committed from the triage bot's local repro checkout.
`/triage/` is gitignored, so the directory does not exist for other
checkouts and the dangling lockfile entry breaks frozen-lockfile
installs in CI. The source changes in this PR do not touch any
dependencies, so the lockfile needs no changes.

* fix: forward prerenderOnly through matchRoute's alt-pathname retry

The retry that strips `.html`/`index.html` re-ran matching without the
prerenderOnly filter, so such requests could still import SSR-only
modules (e.g. cloudflare:workers) in the Node prerender environment.

* chore: add changeset

* test: cover prerender-only route matching in dev

Unit tests pin the two behaviors that had no coverage: prerenderOnly
skips non-prerendered routes before their modules are imported, and the
filter survives the .html alt-pathname retry. An integration test
reproduces #17348 end to end: with prerenderEnvironment 'node' and a
prerendered catch-all route, /_image must fall through to workerd
instead of importing cloudflare:workers in Node. All three fail against
the pre-fix sources.

* fix: return undefined instead of 404 fallback when prerender-only matching skipped candidates

When matchRoute skips non-prerendered candidates in prerenderOnly mode,
falling through to the custom 404 lookup could return a prerendered
404.astro, making the prerender handler render a 404 for requests an SSR
route would have handled (/_image, /api/*, actions, server islands).
Returning undefined lets handleRequest mark the request as not handled so
it falls through to the SSR handler, which does its own full matching.
This also stops the spurious NoMatchingStaticPathFound warning that fired
for every skipped SSR candidate.

* test: pin prerender-only fall-through semantics

Covers the two review findings: a prerendered custom 404 must not shadow
a skipped SSR route (the request falls through to the SSR handler
instead), and NoMatchingStaticPathFound is not logged when candidates
were skipped in prerenderOnly mode. Also keeps a control test that the
404 fallback still applies when nothing was skipped.

---------

Co-authored-by: Alexander Niebuhr <45965090+alexanderniebuhr@users.noreply.github.com>
…17624) (#17625)

When a glob() content collection entry's slug is an unquoted YAML number
(e.g. `slug: 20260624`), `generateIdDefault()` returned it as a JS number
via `data.slug as string` (a no-op type assertion). The numeric id caused
`untouchedEntries.delete(id)` to silently no-op (Set uses ===, and
number !== string), so the cleanup pass deleted the entry on every sync
after the first.

Fix: use `String(data.slug)` in `generateIdDefault()` and wrap the
user-facing `generateId` with `String()` defensively.
…prevent hash collisions (#17595) (#17602)

Co-authored-by: Matthew Phillips <matthewphillips@cloudflare.com>
@pull pull Bot locked and limited conversation to collaborators Aug 7, 2026
@pull pull Bot added the ⤵️ pull label Aug 7, 2026
@pull
pull Bot merged commit 3a890d2 into code:main Aug 7, 2026
@pull pull Bot added the ⤵️ pull label Aug 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants