Skip to content

Tighten ioredis dep range to exclude 5.10.0 #1287

@evantahler

Description

@evantahler

Summary

node-resque's package.json declares ioredis: "^5.9.1". Both ioredis@5.10.0 and ioredis@5.10.1 satisfy that range. In downstream projects that also depend directly on ioredis at a higher pin (e.g. keryx pins ioredis@^5.10.1), bun can end up with two physically distinct copies of ioredis on disk — one under node-resque, one at the top level. TypeScript then sees two nominally-distinct Redis class declarations and reports them as unassignable to each other, due to protected-member nominal typing on AbstractConnector.

Downstream failure

keryx hits this: actionhero/keryx#416

The error in a consumer project's tsc run:

node_modules/.bun/keryx@0.25.3+.../node_modules/keryx/initializers/resque.ts(58,23): error TS2322:
  Type 'Redis' is not assignable to type 'Redis | Cluster | undefined'.
    Type 'import(".../ioredis@5.10.1/.../Redis").default' is not assignable to
         type 'import(".../ioredis@5.10.0/.../Redis").default'.
      Property 'connecting' is protected but type 'AbstractConnector' is not
      a class derived from 'AbstractConnector'.

The root cause is that ^5.9.1 allows both 5.10.0 and 5.10.1 to coexist in a tree where some peers pin tighter. Vercel's build cache makes this especially painful because stale .bun/ioredis@5.10.0 directories survive across deploys even when the lockfile only references 5.10.1.

Ask

Tighten the ioredis range so 5.10.0 can't be picked. Either of:

  • "ioredis": "^5.10.1" — simplest, matches the current known-good version
  • "ioredis": ">=5.10.1 <6" — equivalent, slightly more explicit

A patch release of node-resque with this narrower range would let keryx bump its node-resque dep and close its issue with no code change. Without it, keryx has to ship an as any workaround at every call site that passes api.redis.redis into Queue / Scheduler / Worker.

Context

  • node-resque@9.5.0 / 9.5.1 (both declare ^5.9.1)
  • ioredis@5.10.0 and 5.10.1 both published; ^5.9.1 matches both
  • Reported against keryx 0.25.00.25.3, observed on bun workspaces building on Vercel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions