Error code

Node.js ERR_INVALID_RETURN_VALUE

NODE.JSERR_INVALID_RETURN_VALUE
Runtime Error Code· An error code from a programming runtime or package manager, like Node.js or npm.

What it means

A hook or callback returned a value of the wrong type.

How to fix it

  1. Return the correct type as documented for the hook.
  2. Ensure async hooks return a Promise that resolves to the expected object shape.
  3. Check the Node.js documentation for the hook's required return type.

Not affiliated with Node.js. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.