Fix server islands for prerender-only sites #12982
Merged
+13
−15
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.
Changes
fix #12803
Summary of issue:
output: "server"
).output
(defaults to"static"
), and all pages insrc/pages
are statically built (noexport const prerender = false
), then because of no2, the server island endpoints will not be added./_server-islands/
handling and fails in the browser.This PR:
adapterFeaturs.buildOutput: 'static'
and Astro will error that server islands won't work if they're used after building.Testing
This one is a bit hard to write a test for, but I've updated some existing tests to match this new behaviour, and also manually ran the test in the adapters repo against this PR. It affects one Cloudflare test, but IIUC it's not breaking anything and should only require updating the code/test there to refine the output only. (This specific test)
Docs
n/a. bug fix.