[pull] main from withastro:main - #674
Merged
Merged
Conversation
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.
…dependency hash (#17616)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )