In my case, I forgot to export the function.
Instead of this:
const handler = async () => {
Should be this:
export const handler = async () => {