Encountering an issue with TypeScript while setting up a new Redis instance. I have configured an .env.local file with matching names for the redis URL and token.
Below is the code snippet:
import { Redis } from "@upstash/redis";
// @ts-ignore
export const db: Redis = new Redis({
url: process.env.UPSTASH_REDIS_REST_URL,
token: process.env.UPSTASH_REDIS_REST_TOKEN
})
The TypeScript error message I'm receiving is as follows:
TS2769: No overload matches this call. Overload 2 of 2, '(requesters: Requester): Redis', gave the following error. Argument of type '{ url: string | undefined; token: string | undefined; }' is not assignable to parameter of type 'Requester'. Object literal may only specify known properties, and 'url' does not exist in type 'Requester'.
While referencing the upstash/redis documentation for guidance, the code works but the error remains persistent.
Attempting different actions in WebStorm to prevent the TypeScript errors has been unsuccessful so far.