prisma-redis-middleware icon indicating copy to clipboard operation
prisma-redis-middleware copied to clipboard

Typescript error on `storage.type`

Open mrtl-srn opened this issue 3 years ago • 0 comments

Describe the bug I copied the code form README page and although the code is working well, typescript gives me an error.

Code :

import Prisma from 'prisma';
import Redis from 'ioredis';
import { createPrismaRedisCache } from 'prisma-redis-middleware';

const redis = new Redis();

const cacheMiddleware: Prisma.Middleware = createPrismaRedisCache({
  storage: {
    type: 'redis', // error here : Type '"redis"' is not assignable to type '"memory"'.ts(2322)
    options: {
      client: redis,
      invalidation: { // error here : Type '{ referencesTTL: number; }' is not assignable to type 'boolean | undefined'.ts(2322)
        referencesTTL: 300
      },
      log: console
    }
  },
  // rest of the code
});

image

image

Desktop (please complete the following information):

  • OS: VSCode (1.70.2) devcontainer on WSL2 (Debian)

mrtl-srn avatar Aug 24 '22 08:08 mrtl-srn