Skip to content

fix: prerender no longer silently ignores webpages pertinent to #15620#15621

Open
aenriii wants to merge 7 commits intosveltejs:mainfrom
aenriii:main
Open

fix: prerender no longer silently ignores webpages pertinent to #15620#15621
aenriii wants to merge 7 commits intosveltejs:mainfrom
aenriii:main

Conversation

@aenriii
Copy link
Copy Markdown

@aenriii aenriii commented Mar 30, 2026

closes #15620
closes #10735

This PR addresses #15620, and adds tests for any possible regressions as a result of the implemented fix. (edit: seems to also fix #10735)

Changes:

  • modified kit/src/core/postbuild/analyse.js to add additional metadata fields to route metadata, page.prerender and api.prerender, which pass on the page and endpoint prerender fields. this prevents a regression which forces all parts of a route to prerender even if only one part requests it.
  • modified kit/src/core/postbuild/prerender.js to check if page.prerender and api.prerender is true, and enqueue prerendering if so. uses \x00page as a postfix to page keys within the preexisting seen set to differentiate between api endpoints and pages.
  • modified kit/src/core/postbuild/prerender.js, added and documented expect_html parameter in visit() and enqueue() to specify that the Accept: text/html header should be sent to the internal server when prerendering a page.
  • implemented two tests in prerendering/basics, one which tests the fix itself (see prerender-with-server-endpoint) and one which confirms the non-existence of a possible regression (see linked-api). both tests pass with flying colors :D

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 30, 2026

🦋 Changeset detected

Latest commit: b2775fb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

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

@aenriii aenriii changed the title fix: prerender no longer silently fails pertinent to #15620 fix: prerender no longer silently ignores webpages pertinent to #15620 Mar 30, 2026
aenriii added a commit to Open-Rx/openrx.info that referenced this pull request Apr 1, 2026
@svelte-docs-bot
Copy link
Copy Markdown

@aenriii
Copy link
Copy Markdown
Author

aenriii commented Apr 5, 2026

regressions fixed, should also close #10735

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant