Skip to content

Fix server islands endpoint missing in static Vercel builds - #17680

Merged
matthewp merged 2 commits into
mainfrom
triagebot/fix-17678
Aug 14, 2026
Merged

Fix server islands endpoint missing in static Vercel builds#17680
matthewp merged 2 commits into
mainfrom
triagebot/fix-17678

Conversation

@astrobot-houston

@astrobot-houston astrobot-houston commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Fixes server:defer components returning 404 responses on Vercel when using output: "static".
  • Preserves a dedicated server build directory and packages it through the existing Vercel serverless and middleware path only when Astro runs the SSR build for discovered server islands. Fully static sites continue to emit no serverless function, and server build files are not published as static assets.

Closes #17678

Testing

  • Adds a static server-islands fixture that verifies _render.func, its route configuration, and rendering through the packaged function.
  • Verifies the server entry is excluded from static assets and a fully static fixture does not create a serverless function.

Docs

  • No docs update needed because this restores the documented server:defer behavior for static output.

…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-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 47495cc

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

This PR includes changesets to release 22 packages
Name Type
@astrojs/vercel Patch
@test/astro-vercel-basic Patch
@test/astro-vercel-image Patch
@test/astro-vercel-integration-assets Patch
@test/vercel-isr Patch
@test/vercel-max-duration Patch
@test/vercel-edge-middleware-with-edge-file Patch
@test/vercel-edge-middleware-without-edge-file Patch
@test/astro-vercel-no-output Patch
@test/astro-vercel-prerendered-error-pages Patch
@test/astro-vercel-redirects-serverless Patch
@test/astro-vercel-redirects Patch
@test/vercel-server-islands-static Patch
@test/vercel-server-islands Patch
@test/astro-vercel-serverless-prerender Patch
@test/astro-vercel-serverless-with-dynamic-routes Patch
@test/astro-vercel-static-assets Patch
@test/vercel-static-headers Patch
@test/astro-vercel-static Patch
@test/vercel-streaming Patch
@test/astro-vercel-with-web-analytics-enabled-output-as-static Patch
vercel-hosted-astro-project 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

@github-actions github-actions Bot added the pkg: integration Related to any renderer integration (scope) label Aug 13, 2026
@matthewp

Copy link
Copy Markdown
Contributor

Not sure about this one, doesn't appear to relate to server islands very much.

@johanneskvamme

johanneskvamme commented Aug 13, 2026

Copy link
Copy Markdown

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 😊

@matthewp

Copy link
Copy Markdown
Contributor

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.

@johanneskvamme

Copy link
Copy Markdown

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!

@matthewp matthewp added the pr preview Apply this label to a PR to generate a preview release label Aug 13, 2026
@github-actions github-actions Bot removed the pr preview Apply this label to a PR to generate a preview release label Aug 13, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 13, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@astrojs/vercel@17680

commit: 47495cc

@matthewp

Copy link
Copy Markdown
Contributor

@johanneskvamme can you try out the preview shown above 👆 It's a completely different implementation from what you tried before. Thanks!

@johanneskvamme

johanneskvamme commented Aug 14, 2026

Copy link
Copy Markdown

@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 🙌

@matthewp
matthewp merged commit ce9f1da into main Aug 14, 2026
27 checks passed
@matthewp
matthewp deleted the triagebot/fix-17678 branch August 14, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix verified Reporter confirmed the triage bot fix works pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Astro 7] @astrojs/vercel does not build _render.func/ for server islands when output: "static"

3 participants