Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi/Pipeline operations in cluster mode failing if project processed with babel-loader #1288

Comments

@RomanLubushkin
Copy link

RomanLubushkin commented Feb 10, 2021

The following error occurs if using multi or pipeline operation in the cluster mode if a project processed with babel-loader.

TypeError: Cannot read property 'write' of undefined

Tested on code sample from the docs (assuming cluster is up on 7000-7005 ports):

const Redis = require('ioredis');

async function run() {
  const client = new Redis.Cluster(
    [
      { host: '127.0.0.1', port: 7000 },
      { host: '127.0.0.1', port: 7001 },
      { host: '127.0.0.1', port: 7002 },
      { host: '127.0.0.1', port: 7003 },
      { host: '127.0.0.1', port: 7004 },
      { host: '127.0.0.1', port: 7005 },
    ],
    { lazyConnect: true },
  );
  await client.connect();
  await client.multi()
    .set("foo", "bar")
    .get("foo")
    .exec((err, results) => {
      // results === [[null, 'OK'], [null, 'bar']]
    });
}
run();

Here is an archive with a minimum reproducible project: ioredis-multi-call-issue.zip.

To run the project (assuming cluster is up on 7000-7005 ports):

node dist/server.js

To build the project from sources and run

yarn install
yarn build
yarn start

PS
I've used following image to setup dev cluster

https://hub.docker.com/r/grokzen/redis-cluster/
luin added a commit that referenced this issue Mar 14, 2021
ioredis-robot pushed a commit that referenced this issue Mar 14, 2021
## [4.23.1](v4.23.0...v4.23.1) (2021-03-14)

### Bug Fixes

* **cluster:** issues when code is processed by babel ([#1298](#1298)) ([bfc194d](bfc194d)), closes [#1288](#1288)
@ioredis-robot
Copy link
Collaborator

🎉 This issue has been resolved in version 4.23.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

This was referenced Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment