-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
getStaticPaths()
function required for dynamic routes from _server-islands.astro
#12636
Comments
getStaticPaths()
function required for dynamic routes from _server-islands.astrogetStaticPaths()
function required for dynamic routes from _server-islands.astro
Its not only for dynamic routes either. I have an astro project with a single
The only solution seems to be enabling |
Closing. Server islands, as the name says, are a server feature. It requires an adapter to function. In the reproduction, |
|
The reproduction doesn't even have an adapter. Without an adapter, the build output can't be changed to server automatically. |
I don't want my site to be build on the server every time. In Astro 4 I had the output to hybrid mode so I could prerender my pages but still have server islands in them and everything worked fine.
None of this nor the documentation states that I can or cannot use server islands in pre-rendered routes in the new "static-hybrid" mode. Now in Astro 5 how I'm supposed to have dynamic content like a island that shows the time the page has been requested in a blog? Am I missing something? Because if not now I'm forced to render my routes on the server or give up dynamic content |
Server islands need an adapter, because they are on-demand resources: https://docs.astro.build/en/guides/server-islands/ You can still build your pages statically, however when you use a server island, you'll need an adapter (node, vercel, etc.) that will serve that island for your static page. I hope that clears things out. |
Kinda... By the way, adding the adapter still doesn't shuts up the error when I'm working on localhost |
I added the adapter in the reproduction using |
Thank you for clarification @ematipico |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I think when
index.astro
loads all its content is wrapped intheme.astro
which is a server island bugs the link topageb/[id].astro
generated with getStaticPathsWhat's the expected result?
Build my static paths inside the server island.
The docs don't specify I can't put links to static pages inside server islands
Link to Minimal Reproducible Example
https://stackblitz.com/edit/withastro-astro-m5m9za?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: