{"record":{"id":"cfc61e4a9bfba89a","repo":"withastro/astro","slug":"preview-the-settings-adapter-name-adapter-doe","errorCode":null,"errorMessage":"[preview] The ${settings.adapter.name} adapter does not support the preview command.","messagePattern":"\\[preview\\] The (.+?) adapter does not support the preview command\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/astro/src/core/preview/index.ts","lineNumber":67,"sourceCode":"\n\tif (settings.buildOutput === 'static' && !settings.adapter?.previewEntrypoint) {\n\t\tconst clientOutDir = getClientOutputDirectory(settings);\n\t\tif (!fs.existsSync(clientOutDir)) {\n\t\t\tconst outDirPath = fileURLToPath(clientOutDir);\n\t\t\tthrow new Error(\n\t\t\t\t`[preview] The output directory ${outDirPath} does not exist. Did you run \\`astro build\\`?`,\n\t\t\t);\n\t\t}\n\t\tconst server = await createStaticPreviewServer(settings, logger);\n\t\treturn server;\n\t}\n\n\tif (!settings.adapter) {\n\t\tthrow new Error(`[preview] No adapter found.`);\n\t}\n\n\tif (!settings.adapter.previewEntrypoint) {\n\t\tthrow new Error(\n\t\t\t`[preview] The ${settings.adapter.name} adapter does not support the preview command.`,\n\t\t);\n\t}\n\t// We need to use require.resolve() here so that advanced package managers like pnpm\n\t// don't treat this as a dependency of Astro itself. This correctly resolves the\n\t// preview entrypoint of the integration package, relative to the user's project root.\n\tconst require = createRequire(settings.config.root);\n\tconst previewEntrypointUrl = pathToFileURL(\n\t\trequire.resolve(settings.adapter.previewEntrypoint.toString()),\n\t).href;\n\n\tconst previewModule = (await import(previewEntrypointUrl)) as Partial<PreviewModule>;\n\tif (typeof previewModule.default !== 'function') {\n\t\tthrow new Error(`[preview] ${settings.adapter.name} cannot preview your app.`);\n\t}\n\n\tconst server = await previewModule.default({\n\t\toutDir: settings.config.outDir,","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/astro/src/core/preview/index.ts#L49-L85","documentation":"After confirming an adapter exists, `astro preview` requires it to expose a `previewEntrypoint` — the module Astro imports to create the local preview server. Some adapters (especially those targeting edge/serverless platforms, older versions, or minimal custom adapters) deliberately omit it because their platform serves the built output instead. Preview throws naming the adapter when the property is missing.","triggerScenarios":"Running `astro preview` with an adapter that targets a deploy platform rather than local serving (older Vercel/Cloudflare edge adapters, community adapters without preview support); a custom adapter that only implements `serverEntrypoint`/`exports` and forgot preview; an outdated adapter version predating preview support.","commonSituations":"Trying to verify an SSR build locally before deploying to a serverless platform; upgrading Astro but keeping an old adapter major version; writing an in-house adapter and testing `astro build` + `astro preview` for the first time.","solutions":["Deploy the built output to the adapter's platform instead of using `astro preview` (that is the intended verification path for such adapters)","Add the Node adapter (`npx astro add node`) when you need a local preview server, and swap back for deployment","Update the adapter to the latest version — preview support may have been added","For a custom adapter, implement `previewEntrypoint` exporting a default function that starts a server"],"exampleFix":"# before\nastro preview   # throws: The <adapter> adapter does not support the preview command.\n\n# after — verify locally with the node adapter\nnpx astro add node\nastro build && astro preview\n# or skip preview and deploy the adapter's build output to its platform","handlingStrategy":"type-guard","validationCode":"// before wiring a custom/edge adapter, check its capabilities\nimport myAdapter from './my-adapter.js';\nexport default defineConfig({\n  adapter: supportsPreview(myAdapter) ? myAdapter : undefined,\n});","typeGuard":"// AstroAdapter shape check — does this adapter implement local preview?\nimport type { AstroAdapter } from 'astro';\nexport function supportsPreview(adapter?: AstroAdapter): boolean {\n  return typeof adapter?.previewEntrypoint === 'string';\n}","tryCatchPattern":null,"preventionTips":["Before adopting an adapter, check its README for `preview` support (or run `astro preview` once as a smoke test)","Keep @astrojs/node available as a local-verification fallback for platform-targeted adapters","For custom adapters, implement `previewEntrypoint` with a default-exported function from day one"],"tags":["preview","adapter","ssr","cli"],"backgroundTag":"preview-not-supported","analyzedSha":"52e6c34790cc8ac4e69e6135ace06049867e5c4a","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}