Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[astro 5] not detecting "hybrid" (server) build when having only static pages but some server-islands #12744

Open
1 task
PaulSenon opened this issue Dec 16, 2024 · 2 comments
Assignees
Labels
- P2: has workaround Bug, but has workaround (priority) feat: server islands Related to Server Islands (scope)

Comments

@PaulSenon
Copy link

Astro Info

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 NO page (src/pages/**/*.astro) opting out for prerender (with export const prerender = false;), BUT 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.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 16, 2024
@ematipico ematipico added the - P3: minor bug An edge case that only affects very specific usage (priority) label Dec 17, 2024
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Dec 17, 2024
@ematipico ematipico self-assigned this Dec 17, 2024
@ematipico
Copy link
Member

@PaulSenon I checked out your reproduction, and running pnpm build shows the expected output.

@ematipico ematipico added needs response Issue needs response from OP and removed - P3: minor bug An edge case that only affects very specific usage (priority) labels Dec 17, 2024
@jee-r
Copy link

jee-r commented Dec 17, 2024

Hello, I’m experiencing the same issue both locally and on Vercel. I’ve created a repository with two branches:

Let me know if further clarification is needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: has workaround Bug, but has workaround (priority) feat: server islands Related to Server Islands (scope)
Projects
None yet
Development

No branches or pull requests

3 participants