From 070da6a7926892917f9a3077cd644bd3a1b87e76 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 28 Oct 2022 14:48:20 -0400 Subject: [PATCH] Throw error when trying to use the vercel static adapter in server mode (#5241) --- .changeset/neat-cooks-fail.md | 5 +++++ packages/integrations/vercel/src/static/adapter.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/neat-cooks-fail.md diff --git a/.changeset/neat-cooks-fail.md b/.changeset/neat-cooks-fail.md new file mode 100644 index 000000000..18cd44b29 --- /dev/null +++ b/.changeset/neat-cooks-fail.md @@ -0,0 +1,5 @@ +--- +'@astrojs/vercel': patch +--- + +Fixes unknown error when using vercel/static diff --git a/packages/integrations/vercel/src/static/adapter.ts b/packages/integrations/vercel/src/static/adapter.ts index abc9483f5..454c42432 100644 --- a/packages/integrations/vercel/src/static/adapter.ts +++ b/packages/integrations/vercel/src/static/adapter.ts @@ -22,6 +22,10 @@ export default function vercelStatic(): AstroIntegration { 'astro:config:done': ({ setAdapter, config }) => { setAdapter(getAdapter()); _config = config; + + if(config.output === 'server') { + throw new Error(`${PACKAGE_NAME} should be used with output: 'static'`); + } }, 'astro:build:start': async () => { // Ensure to have `.vercel/output` empty.