Runtime.MalformedHandlerName - Bad handler

After my latest deployment I am getting the following error:

Jun 9, 11:16:42 AM: INIT_START Runtime Version: nodejs:16.v14	Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:699b51cc1e44cad9b43e446b3b6f7e0834a78366955dc81cc7b459b0aa3f9175

Runtime.MalformedHandlerName: Bad handler
    at _splitHandlerString (file:///var/runtime/index.mjs:900:15)
    at Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1031:36)
    at start (file:///var/runtime/index.mjs:1195:42)
    at file:///var/runtime/index.mjs:1201:7
    at (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)

However, I only did a minor change (changed a few numbers in an insignificant function).

I think this might be a netlify bug as it seems very similar to this one: Function not loading due to Runtime.MalformedHandlerName error message

Even a re-build without cache does not help. There are no build errors, everything runs successful.

1 Like

Hi @timoJJ,

I’ve shared this with the devs and would let you know once there’s more info.

@hrishikesh Hi I am getting this issue too.

Note that the presence of an unrelated build file seems to set it off.

Ok build:
Failing build:

You can see me switching between the working build and not working build here: Pull requests · dwjohnston/blacksheepcode · GitHub

Note: I’ve since rebased master to remove all the commits. I did test a change with my twitter tags, but without the file, and it still failed.

This is happening for me now as well on a new site with React 18.2.0 and Next 13.4.4.

The site was working when deployed prior to today when I added Server Actions experimental. I have not yet removed that to test if it’s the root cause, but I wanted to mention it ASAP.

EDIT: I just redeployed the site and it seems to have fixed itself now. Multiple clear cache and deploys last night (around 1am EST) resulted in the error however. I’m suspecting some kind of transient error on the build servers?

I thought this was resolved, but:

Here I have two pull requests, one has a build node script in it, one doesn’t. I’m investigating whether the presence of the node script causes the issue:

The corresponding deploy preview:

deploy preview:

So both of the deploy previews are working fine. I figure it was some intermittent problem,I’m safe to deploy PR 57.

But no, as soon as I merge it, the production deploy has this error. I tried rebuild with clear cache as well.

This is also happening to me starting from yesterday.

Update: fixed after clearing cache and redeploy.

This should now be fixed for everyone, but would need another re-deploy.