Do server actions run on edge?
Thinking about using them in a project but am trying to strictly use edge. Anyone know if they run at edge?
7 Replies
afaik not by default but its possible to get them there, see https://github.com/vercel/next.js/discussions/49605
GitHub
Edge Server Actions · vercel next.js · Discussion #49605
Summary How can Edge Functions be configured in server actions? "use server"; import { revalidatePath } from "next/cache"; import { db } from "~/db"; import { presses ...
Hi this is my issue, havent been able to figure it out yet
None of the responses have been helpful to me
Lee Robinson (@leeerob)
@ccccjjjjeeee Yes, if you turn the runtime for the page to use edge.
https://t.co/DqKqUdui4x
Twitter
Get in there
Wonder if this is the case even if the action exists outside the file (EG: in a
actions.ts
file)@lermatroid yes that was my dilemma, I was trying to use in a
"use server"
file and that requires you to only export async functions... which export const runtime = 'edge'
is notYeah, even though its in alpha I really wish some of the docs around server actions were a bit more clear. Does not make a ton of sense atm.