ioredis-mock icon indicating copy to clipboard operation
ioredis-mock copied to clipboard

Calling an unsupported command in a lua script results in an unclear error

Open hertzquake opened this issue 1 year ago • 0 comments

I have a lua script that was calling zmpop (which is, at the time of writing, unsupported).

Calling this script results in this error: Error trying to loading or executing lua code string in VM: null I traced the error down, and found that:

 TypeError: Cannot read properties of undefined (reading 'bind')
    at _RedisMock.<anonymous> (node_modules/ioredis-mock/src/commands/defineCommand.js:58:19)
    at Object.luaD_precall (/node_modules/fengari/src/ldo.js:169:21)
    [very long stack trace omitted...]

The interesting line here is (src/commands/defineCommand.js:52):

const redisCmd = commands[name].bind(this)

hertzquake avatar Nov 25 '23 20:11 hertzquake