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

Allow async functions in the Vercel edge middleware integration #9334

Merged
merged 4 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/young-spoons-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': minor
Geo25rey marked this conversation as resolved.
Show resolved Hide resolved
---

Allow async functions in the Vercel edge middleware integration.
Geo25rey marked this conversation as resolved.
Show resolved Hide resolved
lilnasy marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion packages/integrations/vercel/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@astrojs/vercel",
"description": "Deploy your site to Vercel",
"version": "6.0.0",
florian-lefebvre marked this conversation as resolved.
Show resolved Hide resolved
"version": "6.1.0",
Geo25rey marked this conversation as resolved.
Show resolved Hide resolved
lilnasy marked this conversation as resolved.
Show resolved Hide resolved
"type": "module",
"author": "withastro",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/vercel/src/serverless/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function edgeMiddlewareTemplate(middlewarePath: string, vercelEdgeMiddlewareHand
if (existsSync(filePathEdgeMiddleware + '.js') || existsSync(filePathEdgeMiddleware + '.ts')) {
const stringified = JSON.stringify(filePathEdgeMiddleware.replace(/\\/g, '/'));
handlerTemplateImport = `import handler from ${stringified}`;
handlerTemplateCall = `handler({ request, context })`;
handlerTemplateCall = `await handler({ request, context })`;
} else {
}
return `
Expand Down
Loading