Where and how are Next.js Server Actions actually executed? The docs just say “the server”.
I am specifically asking about Next.js Server Actions (using the app router) not router handlers in the /api
folder.
- Are Server Actions executed on the Next.js node server?
- What about when deployed to Vercel, are Server Actions executed on the Next.js node server or extracted to “edge functions”?
- Is this configurable?
I deployed a test application to Vercel that uses Server Actions. I noticed in the “Functions” admin panel that there is a index.rsc
function:
The file extension, .rsc
suggests “React Server Component” and leads me to believe that the entire page component function, and not just the Server Actions, (see screenshot of file system) is extracted automatically to an edge function: