Hey,
I am using Astro with Server Islands feature (which is fully supported in v5). When I am running it locally all seems to work fine. But after deploy the default routes for server islands which is .../_server-islands/<Component>
is not found on my deploy.
Astro v5.1.9
Node v20.18.1
System macOS (arm64)
Package Manager npm
Output static
Adapter @astrojs /netlify
Integrations @astrojs /tailwind
Adapter => "@astrojs/netlify": "^6.1.0",
I discovered something interesting. It started working when I added another page with:
export const prerender = false;
.
Only then did it generate the relevant routes. This seems like a bug.
[astro 5] not detecting “hybrid” (server
) build when having only static pages but some server-islands
opened 10:47AM - 16 Dec 24 UTC
- P2: has workaround
feat: server islands
### Astro Info
```block
Astro v5.0.5
Node … v20.18.1
System Linux (arm64)
Package Manager pnpm
Output static
Adapter @astrojs/netlify
Integrations none
```
### If this issue only occurs in one browser, which browser is a problem?
_No response_
### Describe the Bug
When you are in `output: static` and have <ins>NO page</ins> (`src/pages/**/*.astro`) opting out for prerender (with `export const prerender = false;`), <ins>BUT</ins> you have some SSR component imported with `server:defer` (a.k.a. server-island) then the astro hook `astro:config:done` it returning `buildOutput: static` instead of `server` and it makes the adapters not building the ssr entrypoint for the server-islands.
> this must be a little edge case from Astro v5 when they merged the static and hybrid mode. Now it doesn't assume we are hybrid when we don't have any ssr page (even if they contains server-islands)
> [!TIP]
> As a workaround simply add a unused page with `export const prerender = false;` and it will trick Astro to think we are hybrid
### What's the expected result?
When I have have `output: static`, and only static pages, but at least one server-island, then astro should detect the output as "hybrid" (`server` to be precise).
Read the README from reproduction URL
### Link to Minimal Reproducible Example
https://github.com/PaulSenon/issue-reproduction-astro-netlify-adapter/tree/astro-static-issue?tab=readme-ov-file
### Participation
- [ ] I am willing to submit a pull request for this issue.