Skip to content

Include injected routes when checking if renderers are needed in SSR builds#16178

Merged
matthewp merged 1 commit intomainfrom
ssr-renderers-injected-routes-only
Apr 1, 2026
Merged

Include injected routes when checking if renderers are needed in SSR builds#16178
matthewp merged 1 commit intomainfrom
ssr-renderers-injected-routes-only

Conversation

@matthewp
Copy link
Copy Markdown
Contributor

@matthewp matthewp commented Apr 1, 2026

Changes

  • SSR builds with only injected routes (no src/pages/ directory) were failing at runtime with No matching renderer found.
  • The renderer plugin's build optimization strips renderers from the SSR bundle when it determines no SSR pages need them. The way it determines this was not accounting for injected routes. This fixes it.

Testing

  • Added unit tests for hasNonPrerenderedRoute covering: project pages, prerendered pages, endpoint exclusion, and the new includeExternal option with injected routes.
  • Verified end-to-end against HiDeoo's reproduction

Docs

  • N/A, bug fix

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Apr 1, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 1, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing ssr-renderers-injected-routes-only (fb6850e) with main (4eec0f1)

Open in CodSpeed

@matthewp matthewp marked this pull request as ready for review April 1, 2026 13:15
@matthewp matthewp merged commit a7e7567 into main Apr 1, 2026
26 checks passed
@matthewp matthewp deleted the ssr-renderers-injected-routes-only branch April 1, 2026 15:08
@astrobot-houston astrobot-houston mentioned this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants