How do I deploy a server-side rendered Astro site with a Node.js adapter on Netlify?
When i push this site to production I see:
Runtime.ImportModuleError - Error: Cannot find module 'sharp' Require stack: - /var/task/.netlify/functions-internal/entry.js - /var/task/entry.js - /var/runtime/index.mjs
this is probably becouse I showes me in functions tab that i have entry function but i dont specyfy it.
this is my astro.config.mjs
import { defineConfig } from "astro/config";
import preact from "@astrojs/preact";
import sitemap from "@astrojs/sitemap";
import image from "@astrojs/image";
import compress from "astro-compress";
// https://astro.build/config
import node from "@astrojs/node";
// https://astro.build/config
export default defineConfig({
site: "https://kluzko.tech",
trailingSlash: "always",
output: "server",
adapter: node({
mode: "standalone",
}),
integrations: [
preact({
compat: true,
}),
sitemap({
customPages: ["https://kluzko.tech/about", "https://kluzko.tech/contact"],
}),
image({
serviceEntryPoint: "@astrojs/image/sharp",
}),
compress({
css: true,
html: false,
img: true,
js: true,
svg: false,
logger: 1,
}),
],
vite: {
ssr: {
noExternal: ["react-hot-toast"],
},
},
});
and here is my netlify.toml
[build]
command = "pnpm build"
publish = "dist"