The typing for the sandbox variable is incorrect. It's typed as Map<string, any> but the JS code assumes it's and plain object. Should be changed to type {}.