Serverless Function contains invalid runtime error

Why am I seeing this error?

Vercel recently enabled support for Node.js v20. Our builder is based on Amazon Linux 2023 (AL2023), which contains a new version of glibc, a dependency of any native executable. This version of glibc is different from the version on AWS Lambda and therefore projects built on AL2023 will now be incompatible when executed on AWS Lambda that do not use AL2023.

Vercel will fail your project build before it gets deployed instead of letting your project fail at runtime

How do I fix this error?

While we continue to work on a solution, you should ensure your project remains on Node.js v18 (which uses a compatible build image). Node.js v18 will not be deprecated until at least 2025, and we are actively pursuing solutions to support your project on the latest Node.js version.

Couldn't find the guide you need?