Deploying Astro in SSR Mode

I’m trying to deploy my website with astro in SSR Mode. I set the publish directory in dist/client as the docs says, but when i go to my site it has a not found error. Why?

10:02:39 [types] Generated 95ms

Aug 4 06:02:39 AM10:02:39 [check] Getting diagnostics for Astro files in /opt/render/project/src…

Aug 4 06:02:45 AMResult (28 files):

Aug 4 06:02:45 AM- 0 errors

Aug 4 06:02:45 AM- 0 warnings

Aug 4 06:02:45 AM- 0 hints

Aug 4 06:02:45 AM

Aug 4 06:02:47 AM10:02:47 [WARN] [config] The feature “astro:env getSecret” is experimental and subject to change (used by @astrojs/node).

Aug 4 06:02:47 AM10:02:47 [types] Generated 89ms

Aug 4 06:02:47 AM10:02:47 [build] output: “server”

Aug 4 06:02:47 AM10:02:47 [build] directory: /opt/render/project/src/dist/

Aug 4 06:02:47 AM10:02:47 [build] adapter: @astrojs/node

Aug 4 06:02:47 AM10:02:47 [build] Collecting build info…

Aug 4 06:02:47 AM10:02:47 [build] ✓ Completed in 174ms.

Aug 4 06:02:47 AM10:02:47 [build] Building server entrypoints…

Aug 4 06:02:52 AM10:02:52 [vite] ✓ built in 4.34s

Aug 4 06:02:52 AM10:02:52 [build] ✓ Completed in 4.39s.

Aug 4 06:02:52 AM

Aug 4 06:02:52 AM building client (vite)

Aug 4 06:02:52 AM10:02:52 [vite] transforming…

Aug 4 06:02:53 AM10:02:53 [vite] ✓ 110 modules transformed.

Aug 4 06:02:53 AM10:02:53 [vite] rendering chunks…

Aug 4 06:02:53 AM10:02:53 [vite] computing gzip size…

Aug 4 06:02:53 AM10:02:53 [vite] dist/client/_astro/hoisted.3mchMEGZ.js 0.25 kB │ gzip: 0.22 kB

Aug 4 06:02:53 AM10:02:53 [vite] dist/client/_astro/hoisted.DwmkkyA2.js 130.76 kB │ gzip: 30.33 kB

Aug 4 06:02:53 AM10:02:53 [vite] ✓ built in 1.01s

Aug 4 06:02:53 AM10:02:53

Aug 4 06:02:53 AM finalizing server assets

Aug 4 06:02:53 AM

Aug 4 06:02:53 AM10:02:53 [build] Rearranging server assets…

Aug 4 06:02:53 AM10:02:53 [build] Server built in 5.62s

Aug 4 06:02:53 AM10:02:53 [build] Complete!

Aug 4 06:02:54 AM==> Uploading build…

Aug 4 06:03:02 AM==> Your site is live :tada:

It seems well, even though i don’t know what that warn message means

Hi Carlos,

Based on the looks of your logs, and since you mentioned a publish directory, it sounds like you may be trying to deploy a Static Site. However, if you’re trying to use SSR you’ll need a Web Service to handle those requests. It sounds like you’ll need to set up an adapter in Astro as well: https://docs.astro.build/en/guides/server-side-rendering/#add-an-adapter.

Regards,

Matt

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.