Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this? Does this mean there is Vercel adapter needed for static build?

I am experimenting with Vercel without adapters and Im having trouble with "command astro not found issue" which is in my dependencies.

Is this adapter meant to fix issues like this?

}
},
'astro:build:start': async () => {
// Ensure to have `.vercel/output` empty.
Expand Down