You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Next.js it is possible to deploy an endpoint as a Vercel edge function. Contrary to the global edge: boolean option of SvelteKit adapter-vercel, it is possible to choose the runtime (lambda or edge) on a per endpoint basis.
I have an application where I need this because some of my routes cannot be deployed to the edge (they use native NodeJs dependencies), and some of my routes need the ability to finish some async work after a response is returned (which is not possible in lambdas).
My current workaround is to amend the build output of SvelteKit by creating a .vercel/output/myedgefunc.func directory that follows the Vercel build output API. It works, but is complicated and fragile. It would make my life easier if this was supported by the framework.
The text was updated successfully, but these errors were encountered:
This is definitely something we want to do post-1.0. The challenge is designing it in a sufficiently future-proof and framework-agnostic way (e.g. it would make sense to use the same approach for Netlify)
benmccann
changed the title
Deploy an endpoint as a Vercel edge function
Configure deployment as Vercel edge functions on a per-endpoint basis
Nov 15, 2022
Describe the problem
In Next.js it is possible to deploy an endpoint as a Vercel edge function. Contrary to the global
edge: boolean
option of SvelteKitadapter-vercel
, it is possible to choose the runtime (lambda or edge) on a per endpoint basis.Describe the proposed solution
In
+page.js
export something similar toAlternatives considered
No response
Importance
would make my life easier
Additional Information
I have an application where I need this because some of my routes cannot be deployed to the edge (they use native NodeJs dependencies), and some of my routes need the ability to finish some async work after a response is returned (which is not possible in lambdas).
My current workaround is to amend the build output of SvelteKit by creating a
.vercel/output/myedgefunc.func
directory that follows the Vercel build output API. It works, but is complicated and fragile. It would make my life easier if this was supported by the framework.The text was updated successfully, but these errors were encountered: