{"record":{"id":"a2824c6d9d6c02b4","repo":"withastro/astro","slug":"this-project-contains-server-rendered-routes-but","errorCode":null,"errorMessage":"This project contains server-rendered routes, but no adapter is installed. This is fine for development, but an adapter will be required to build your site for production.","messagePattern":"This project contains server-rendered routes, but no adapter is installed\\. This is fine for development, but an adapter will be required to build your site for production\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/astro/src/core/dev/adapter-validation.ts","lineNumber":12,"sourceCode":"import { getAdapterStaticRecommendation } from '../../integrations/features-validation.js';\nimport type { AstroSettings } from '../../types/astro.js';\nimport type { AstroAdapter } from '../../types/public/integrations.js';\nimport { AstroError, AstroErrorData } from '../errors/index.js';\nimport type { AstroLogger } from '../logger/core.js';\n\nlet hasWarnedMissingAdapter = false;\n\nexport function warnMissingAdapter(logger: AstroLogger, settings: AstroSettings) {\n\tif (hasWarnedMissingAdapter) return;\n\tif (settings.buildOutput === 'server' && !settings.config.adapter) {\n\t\tlogger.warn(\n\t\t\t'config',\n\t\t\t'This project contains server-rendered routes, but no adapter is installed. This is fine for development, but an adapter will be required to build your site for production.',\n\t\t);\n\t\thasWarnedMissingAdapter = true;\n\t}\n}\n\nexport function validateSetAdapter(\n\tlogger: AstroLogger,\n\tsettings: AstroSettings,\n\tadapter: AstroAdapter,\n\tmaybeConflictingIntegration: string,\n\tcommand?: 'dev' | 'build' | string,\n) {\n\tif (settings.adapter && settings.adapter.name !== adapter.name) {\n\t\tthrow new Error(\n\t\t\t`Integration \"${maybeConflictingIntegration}\" conflicts with \"${settings.adapter.name}\". You can only configure one deployment integration.`,\n\t\t);","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/astro/src/core/dev/adapter-validation.ts#L1-L30","documentation":"The project's build output is server (SSR routes present) but no adapter is configured. The dev server can serve these routes fine; producing a deployable production build requires an adapter that emits the server entrypoint. The warning is printed once per process (module-level hasWarnedMissingAdapter flag).","triggerScenarios":"settings.buildOutput === 'server' (output: 'server', or prerender = false pages) while astro.config has no `adapter` entry — checked when running `astro dev`.","commonSituations":"Starting an SSR project before choosing a deploy target; temporarily removing the adapter while refactoring; scaffolding templates that default to server output.","solutions":["Install and register an adapter matching your host, e.g. @astrojs/node, @astrojs/vercel, @astrojs/cloudflare","Or make the site fully static (prerender all pages / output: 'static') if server rendering is not needed"],"exampleFix":"// before — astro.config.mjs\nexport default defineConfig({ output: 'server' });\n\n// after\nimport node from '@astrojs/node';\nexport default defineConfig({\n  output: 'server',\n  adapter: node({ mode: 'standalone' }),\n});","handlingStrategy":"validation","validationCode":"// fail production CI when SSR output has no adapter\nimport config from './astro.config.mjs';\nif (!config.adapter && (config.output === 'server' || config.output === 'hybrid')) {\n  throw new Error('SSR build requires an adapter');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Choose and register the adapter as the first step of any SSR project","Run `astro build` in CI, not just dev — the build surfaces adapter problems","Re-check the adapter whenever adding API routes or prerender = false pages"],"tags":["adapter","ssr","build"],"backgroundTag":"ssr-missing-adapter","analyzedSha":"52e6c34790cc8ac4e69e6135ace06049867e5c4a","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}