{"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/d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca/packages/astro/src/core/preview/index.ts#L49-L85","documentation":"Thrown by preview when an adapter is configured but it does not expose a previewEntrypoint. Not all adapters implement local previewing (some target serverless platforms where local preview is meaningless), so preview refuses to run if the entrypoint is absent.","triggerScenarios":"Running `astro preview` with an adapter whose previewEntrypoint is undefined/falsy. The check `if (!settings.adapter.previewEntrypoint)` fires after confirming an adapter exists.","commonSituations":"Using a serverless adapter (e.g. certain versions of cloudflare/vercel/netlify) that omits preview support; an older adapter version that predates previewEntrypoint; a custom adapter not implementing the preview hook.","solutions":["Upgrade the adapter to a version that provides previewEntrypoint.","Use an adapter that supports local preview (e.g. @astrojs/node for standalone preview).","Preview the static client build separately, or deploy to a staging environment if local preview is unsupported."],"exampleFix":"// before - adapter without preview support\n// (serverless adapter, no previewEntrypoint)\nastro preview  // throws\n\n// after\nnpx astro add node  // switch to node adapter for local preview\nastro build && astro preview","handlingStrategy":"validation","validationCode":"// Confirm the adapter supports preview before running it.\nconst adapter = settings.adapter;\nif (!adapter?.previewEntrypoint) {\n  throw new Error(`${adapter?.name ?? 'adapter'} does not support preview`);\n}","typeGuard":"function adapterSupportsPreview(adapter: { previewEntrypoint?: unknown } | undefined): boolean {\n  return Boolean(adapter?.previewEntrypoint);\n}","tryCatchPattern":null,"preventionTips":["Choose an adapter that supports local preview (e.g. @astrojs/node) when you need preview.","Upgrade adapters to versions that ship previewEntrypoint.","For serverless adapters, deploy to a staging env instead of using preview."],"tags":["preview","adapter","ssr","cli"],"backgroundTag":null,"analyzedSha":"d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca","analyzedAt":"2026-08-12T13:37:29.035Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}