Next.js Discord

Discord Forum

Server actions must be async functions

Answered
Bharat posted this in #help-forum
Open in Discord
./app/actions.tsx
Error:
x Server actions must be async functions
,-[main-app/app/actions.tsx:4:1]
4 | import _regeneratorRuntime from "main-app/node_modules/next/dist/compiled/@babel/runtime/regenerator/index.js";
5 | import { revalidatePath } from 'next/cache';
6 | import Papa from 'papaparse';
7 | export function create(_x) {
: ^^^^^^
8 | return _create.apply(this, arguments);
9 | }

I am getting above error in nextjs, any help?
Answered by Bharat
Hey Joulev,

Thanks for your reply,
this is the server action signature: export async function create()

but

issue is resolved by removing the babel config

Thanks for your time!
View full answer

2 Replies