Fix server islands endpoint missing in static Vercel builds - #17680
Conversation
…builds When `output: "static"` with `server:defer` components, the Vercel adapter now detects the SSR entry built by Astro core and creates a `_render.func` serverless function with the necessary `/_server-islands/*` route in config.json. Previously, all function creation was gated behind `buildOutput === 'server'`, causing server island requests to 404. Fixes #17678
🦋 Changeset detectedLatest commit: 47495cc The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
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 |
|
Not sure about this one, doesn't appear to relate to server islands very much. |
Could you elaborate? I have not evaluated (nor even looked at) the code proposed by the LLM, but my issue of server islands on an Astro project with no on-demand rendered pages 404s on Vercel is resolved by this. I did indeed test it on both a dummy project (my MRE) and my real project. That issue is server island specific, no? Or have I misunderstood? Whether this is a good or even the right solution is something I can't tell, but it did fix the issue 😊 |
|
Implementation doesn't seem right, doesn't actually detect server islands at all. Seems to build the static entrypoint always. So fixes your issue yes, but probably in the wrong way. I'll dig into it more. |
Oh, okay, I see. Thanks! |
commit: |
|
@johanneskvamme can you try out the preview shown above 👆 It's a completely different implementation from what you tried before. Thanks! |
@matthewp Thank you for the quick response! I have tested both on the MRE and my actual project, and server island seems to resolve nicely in Vercel with the new fix too 🙌 |
Changes
server:defercomponents returning 404 responses on Vercel when usingoutput: "static".Closes #17678
Testing
_render.func, its route configuration, and rendering through the packaged function.Docs
server:deferbehavior for static output.