Edge Function unsupported module - which was working before

For anyone having the same issue, the problem comes from exporting the config on the edge functions like this:

export const config = {
  runtime: 'edge',
  regions: ['iad1'],
  // maxDuratioin: 500,
};

export default async (req: Request) => {
...
}

For some reason vercel is throwing an error using that approach. So you should change it to this:

export const runtime = 'edge';

And create your endpoints the same way you do on Next.js:

export const POST = async (req: Request) => {
...
}
1 Like