Using Bun Redis with Effect: Handling Unsupported Service Accessors Error

has anyone been able to use bun redis with effect?

here's what i've done so far:

import { RedisClient } from 'bun';
import { Effect, Layer } from 'effect';

import { Envs } from '@/shared/config/envs';

export class Redis extends Effect.Tag('Redis')<Redis, RedisClient>() {
  static readonly accessors = false;
}

export const RedisLive = Layer.effect(
  Redis,
  Effect.gen(function* () {
    const { db } = yield* Envs;

    return new RedisClient(db.REDIS_URL, {
      maxRetries: 3,
      connectionTimeout: 10000
    });
  })
);


in the Redis class, i got the following error: Even if accessors are enabled, accessors for set, hset, hgetex, hsetex, hexpire, hexpireat, hpexpire, hpexpireat, hmset, hmget, hrandfield, hscan, srandmember, spop, lpop, rpop, scan, zpopmax, zpopmin, zrandmember, zrange, zrevrange, zrangebylex, zrangebyscore, zrevrangebyscore, zrank, zrevrank, getex, ping, subscribe, unsubscribe, copy, zdiff, zinter, zintercard, zunion won’t be available because the signature have generic type parameters or multiple call signatures. effect(unsupportedServiceAccessors) (effect 21)
Was this page helpful?