Error message: clarify "adapter does not have previewEntrypoint" (#5182)

* clarify preview error message

* Update packages/astro/src/core/preview/index.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
This commit is contained in:
Dan Jutan 2022-10-26 14:35:34 -04:00 committed by GitHub
parent 707cac9fdf
commit 81310b1dde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,7 @@ export default async function preview(
throw new Error(`[preview] No adapter found.`);
}
if (!settings.adapter.previewEntrypoint) {
throw new Error(`[preview] adapter does not have previewEntrypoint.`);
throw new Error(`[preview] The ${settings.adapter.name} adapter does not support the preview command.`);
}
// We need to use require.resolve() here so that advanced package managers like pnpm
// don't treat this as a dependency of Astro itself. This correctly resolves the