#How to disable SSR
1 messages Β· Page 1 of 1 (latest)
Do you want to switch it off per page or remove SSR from the whole project?
If you want to prerender specific pages/endpoints you can use export const prerender = true; https://docs.astro.build/en/guides/server-side-rendering/#opting-out-of-server-rendering
Many thanks for your prompt response! I would like to disable completely if possible.
That is a bit more complicated because it depends on how your website is coded, for example if your using APIs/endpoints in your project you will not be able to when using SSG
But if your website is simple you can:
- Uninstall your SSR adapter and remove from Astro config
- Remove
outputoption or turn it tostatic - Rewrite dynamic pages to use
getStaticPaths()
Itβs just an adjusted blog starter template so it is uncomplicated.
Is there a terminal command similarly to installation?
No there is no CLI for it
The function dies on blog posts only so I could also just deactivate for blog posts.
What do you mean?
Is it a dynamic route that is failing? You have to rewrite it to use getStaticPaths()
The site works fine. But when I click on my blog and then click on a post I am getting an HTTP 500 Error. The site is: thunderous-naiad-a200c4 and then the netlify domain part.
Did you turn it to SSG or is this still SSR?
It is still SSR.
Not sure why it is happening, do you have a repo or some code I can look at?
This is the repo
It is the starter blog template deployed with Netlify and then slightly adjusted.
What's the reason you were using SSR in the first place?
If you don't have an use case for it, you can honestly just remove this line and the line below: https://github.com/lukasbelka/lbdev/blob/master/astro.config.mjs#L25
Well I wanted to use some svelte in some part of the site. That was the reason. However, I think that I can include it seperately on a subdomain as well to avoid any issues with that. π
You can use Svelte with SSG too, you don't need SSR to use a UI framework like Svelte
Ok, that was not clear to me. So I can just delete the two lines as stated right?
Yes, and uninstall @astrojs/netlify
Ok, I will try it. And give feedback on that. Many thanks to both of you - you made my day! ππ» My deployment is not at risk by @unistall/Netlify right?