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

Catch all page ([...slug].astro) catch all Server island requests #11793

Open
1 task
dylanalizon opened this issue Aug 20, 2024 · 5 comments · May be fixed by #12263
Open
1 task

Catch all page ([...slug].astro) catch all Server island requests #11793

dylanalizon opened this issue Aug 20, 2024 · 5 comments · May be fixed by #12263
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) feat: server islands Related to Server Islands (scope)

Comments

@dylanalizon
Copy link

Astro Info

Astro                    v4.14.3
Node                     v18.20.3
System                   Linux (x64)
Package Manager          unknown
Output                   server
Adapter                  @astrojs/node
Integrations             none

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

No response

Describe the Bug

All requests from the server islands (/_server-islands/*) are caught by the catchall page ([...slug].astro). This works locally but when you run npm run build and npm run preview or deploy (tested on Vercel) server island requests are caught by the route.

What's the expected result?

All server island requests (/_server-islands/*) must not be caught by the [...slug].astro page.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-wmamgi?file=astro.config.mjs

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 Aug 20, 2024
@florian-lefebvre
Copy link
Member

@Fryuni do you think it's fixed by the global route priority flag?

@dylanalizon
Copy link
Author

@Fryuni do you think it's fixed by the global route priority flag?

I've just tested it, but it doesn't fix the problem.

@Fryuni
Copy link
Member

Fryuni commented Aug 20, 2024

I think the server islands route is being appended after the routes get sorted

@matthewp matthewp added feat: server islands Related to Server Islands (scope) - P4: important Violate documented behavior or significantly impacts performance (priority) and removed needs triage Issue needs to be triaged labels Aug 20, 2024
@matthewp matthewp self-assigned this Sep 18, 2024
@pablopunk
Copy link

Not only catch-all routes but also 2-level routes like /[team]/[user].astro since that will match /_server-islands/ComponentName

@tedevra
Copy link

tedevra commented Oct 17, 2024

in the final build that is being deployed, there is no route file for _server-islands...

i think that this is the reasong behind this problem, the file is missing, so requests to urls that start with "/_server-island" will be caught by the custom catch all routes of the project.
Could have something to do with the adapter that performs the build transformations for the specific environment (cloudflare, vercel, ...)?

For example: Astro adds a route file for Actions, if you are using that feature:
image
but no "/pages/server-islands/---path_.astro.mjs"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) feat: server islands Related to Server Islands (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants