-
Notifications
You must be signed in to change notification settings - Fork 349
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
IDEA: Investigate Next.js Edge Runtime compatibility #4193
Comments
So I'm giving it another try to get Edge functions working and this is what I've got so far. PR where progress can be tracked MotivationWe currently deploy the Mesh in Next.js API functions which is running on AWS Lambda. Which has two considerable issues:
I do have my reservations about edge functions if they are good enough: They currently allow for 50ms of CPU time and 128MB of RAM. I'm not quite sure how all this is measured and if this is split in 'bootup' and 'execution'. Trying to get this to find out :) Current issuesUpdating the api/graphql.ts file to be this allows it to somewhat work on my machine: import { createBuiltMeshHTTPHandler } from '@graphcommerce/graphql-mesh'
import { NextRequest } from 'next/server'
const handler = createBuiltMeshHTTPHandler()
export default async function handle(request: NextRequest) {
return handler.fetch(request.url, request)
}
export const config = { runtime: 'edge' } To even get to a buildable state we need to patch quite a few packages, to remove occurrences of After that it seems to be doing something, during development:
Since it build I've tried to deploy it to the online environment, but running into issues there:
I tried configuring INMEMORY_LRU directly but then getting the same error. @ardatan Running into quite a few roadblock to get this to work unfortunately, not sure how to resolve these. Would be nice to get over a few bumps so I can investigate further. |
https://nextjs.org/docs/api-routes/edge-api-routes
The text was updated successfully, but these errors were encountered: