-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Injected Routes are not being pre-rendered in hybrid mode. #7721
Comments
I believe |
I did test that and could not get that to render the route. I updated the
stackblitz example with the additional value. I also tried logged the routes in
the astro:build:done hook and can see that prerender is still set to false.
|
Hmm, odd. When using |
Some more context from @delucis here on a similar issue. #7642 (comment) This seems like a poor API design choice on our end, I would expect both formats to work in this case. |
I'm surprised |
Still seeing an issue with |
Is this still an issue with Astro 3? Also, ./src/ is expected to work and src/ shouldn't be used anymore, correct? |
The bugs themselves are fixed but a test could be added before this issue closes. |
This issue is still happening for
injectRoute({
pattern: '/[...path]',
entrypoint: 'mypackage/route.ts',
prerender: true,
}); This works: injectRoute({
pattern: '/[...path]',
entrypoint: 'mypackage/route.astro',
prerender: true,
}); |
Sorry for the lack of updates here! Confirming that this is definitely still an issue. I'll make sure this gets back on our TODO list. |
@natemoo-re @Fryuni, I am far from being an astro expert (but we like it so far! 😄), yet we are trying to create integrations that can be distributed via npm (obviously). We have noticed that when we use injectRoute({
pattern: '/sitemap.xml',
entrypoint: '@flyo/nitro-astro/sitemap.js'
}) injectRoute({
pattern: '/sitemap.xml',
entrypoint: 'sitemap.js'
}) injectRoute({
pattern: '/sitemap.xml',
entrypoint: './sitemap.js'
})
No matter what, the above Here is the full integration: https://github.com/flyocloud/nitro-astro/blob/main/index.ts#L60-L63 Does this issue confirm my bug, or is it something different and I should create a new issue? |
|
Thank you so much @Fryuni it works! Should i send a PR for improve the documentations? So everyone struggling on this could profit from your generous answer.
|
If you have an idea for an improvement I think it will be welcomed. Be sure to check the docs contributing guide if it is your first time. |
I will look into this issue. |
Closing the issue. I tested the reproduction with the latest Astro, and both injected routes are correctly pre-rendered. |
What version of
astro
are you using?2.8.5
Are you using an SSR adapter? If so, which one?
Node
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
When output is set to hybrid and routes are injected using an adapter, the injected routes are not pre-rendered. The routes are pre-rendered if no output is set. If the output is set to server and export const prerender = true is set in the frontmatter, the route still is not prerendered.
What's the expected result?
I expect injected routes to pre-render by default in hybrid mode. An alternative could be to ensure the front matter "prerender" variable works normally on injected routes or perhaps add a configuration on the injected routes.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/astro-ccvkpy?file=astro.config.mjs
Participation
The text was updated successfully, but these errors were encountered: