Skip to content

Problem after upgrading from Astro 5 to 6: Server Island (server:defer) returns 404 in production on Netlify, works fine in dev #16049

@PanRoR

Description

@PanRoR

Astro Info

Astro                    v6.0.8
Vite                     v7.3.1
Node                     v24.14.0
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  @astrojs/netlify (v7.0.4)
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

All

Describe the Bug

When using a Server Island with server:defer, everything works as expected on the local dev server.
However, after deploying to Netlify, the server island fails to load and the browser console shows:

Failed to load resource: the server responded with a status of 404 ()

The request URL points to the server island endpoint.

Steps to Reproduce

  1. Create a component using server:defer
  2. Run astro dev → works fine
  3. Deploy to Netlify → server island returns 404

Expected Behavior

The server island loads correctly in production, just as it does in development.

Actual Behavior

The server island endpoint returns a 404 in the Netlify production deployment.

This issue did not occur in Astro 5, where server islands worked correctly in production on Netlify.

What's the expected result?

If I'm using server:defer incorrectly, an explanation of what I'm doing wrong would be helpful.
Otherwise, the server island should load successfully in production just as it does in the dev server.

Link to Minimal Reproducible Example

https://github.com/PanRoR/astro-server-island-netlify

I got a netlify deployment running: https://astro6netlify.netlify.app/

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions