Throw error when trying to use the vercel static adapter in server mode (#5241)

This commit is contained in:
Matthew Phillips 2022-10-28 14:48:20 -04:00 committed by GitHub
parent 83fd265950
commit 070da6a792
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/vercel': patch
---
Fixes unknown error when using vercel/static

View file

@ -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.