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

Server islands do not work OOTB with Cloudflare Pages and a 404 page #489

Open
1 task done
soopyc opened this issue Dec 18, 2024 · 4 comments
Open
1 task done

Server islands do not work OOTB with Cloudflare Pages and a 404 page #489

soopyc opened this issue Dec 18, 2024 · 4 comments

Comments

@soopyc
Copy link

soopyc commented Dec 18, 2024

Astro Info

Astro                    v5.0.9
Node                     v23.2.0
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  @astrojs/cloudflare
Integrations             none

Describe the Bug

When using the Cloudflare adapter with a prerendered 404 page, the server islands route is not included in the _routes.json file, causing server islands to not function.

{
  "version": 1,
  "include": [
    "/",
    "/_image"
  ],
  "exclude": []
}

Local wrangler output on the minimal example:

[wrangler:inf] GET / 200 OK (5ms)
[wrangler:inf] GET /_server-islands/Defer 404 Not Found (9ms)

Tested with local wrangler and production Cloudflare pages.

Manually adding /server_islands/* to routes.extend.include[] works but that does not feel like an intended behavior.

What's the expected result?

/_server-islands/* is included in the generated _routes.json file if one or more server island exists, or in some other way that server islands work.

Link to Minimal Reproducible Example

https://github.com/soopyc/astro-cf-404-mre

Participation

  • I am willing to submit a pull request for this issue.
@soopyc
Copy link
Author

soopyc commented Dec 18, 2024

Just peeked at PRs and looks like #454 would resolve this. Should this be closed now or until the PR has been merged?

@alexanderniebuhr
Copy link
Member

Please keep this open. In theory the /_server-islands/* definition should be added in the current approach too, not sure why it doesn't. Any ideas @florian-lefebvre?
Still hoping to land #454 soon :)

@florian-lefebvre
Copy link
Member

florian-lefebvre commented Dec 19, 2024

I think this issue may be the same as withastro/astro#12744, I haven't check the repro but the description sounds similar.

EDIT: it may be a combination of the astro issue i linked with a bug introduced in a astro PR that the PR Alex linked will fix

@Trombach
Copy link

Trombach commented Dec 20, 2024

I'm having the same issue on Vercel. Server island route returns 404 since 5.0.6 or something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants