Skip to content

Commit

Permalink
Throw error when trying to use the vercel static adapter in server mo…
Browse files Browse the repository at this point in the history
…de (#5241)
  • Loading branch information
matthewp authored Oct 28, 2022
1 parent 83fd265 commit 070da6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-cooks-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': patch
---

Fixes unknown error when using vercel/static
4 changes: 4 additions & 0 deletions packages/integrations/vercel/src/static/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 070da6a

Please sign in to comment.