© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•2y ago•
2 replies
Brunão77

Build SSR Astro

When i try deploy my web it gives me an error in the build

I solved it with this config in astro.config.mjs
import { defineConfig } from "astro/config";
import preact from "@astrojs/preact";
import tailwind from "@astrojs/tailwind";
import cloudflare from "@astrojs/cloudflare";

// https://astro.build/config
export default defineConfig({
  integrations: [
    preact({
      compat: true,
    }),
    tailwind(),
  ],
  output: "server",
  adapter: cloudflare(),
  vite: {
    ssr: {
      external: ["oslo", "nodemailer", "pg"],
    },
  },
});
import { defineConfig } from "astro/config";
import preact from "@astrojs/preact";
import tailwind from "@astrojs/tailwind";
import cloudflare from "@astrojs/cloudflare";

// https://astro.build/config
export default defineConfig({
  integrations: [
    preact({
      compat: true,
    }),
    tailwind(),
  ],
  output: "server",
  adapter: cloudflare(),
  vite: {
    ssr: {
      external: ["oslo", "nodemailer", "pg"],
    },
  },
});

and now it throws me this error
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

[SSR][Astro] Does it even work
Cloudflare DevelopersCDCloudflare Developers / pages-help
4y ago
string-width build error with Astro?
Cloudflare DevelopersCDCloudflare Developers / pages-help
2y ago
Astro build cache not saving/restoring
Cloudflare DevelopersCDCloudflare Developers / pages-help
2y ago
SSR not working on cloud flare for Astro
Cloudflare DevelopersCDCloudflare Developers / pages-help
17mo ago