upstash / issues

Issue Tracker for Upstash
https://upstash.com
2 stars 0 forks source link

Getting an error even after installing @upstash/redis package #95

Open Revaycolizer opened 2 months ago

Revaycolizer commented 2 months ago

I am getting an error Cannot find module '@upstash/redis' or its corresponding type declarations.ts(2307)

import { Ratelimit } from '@upstash/ratelimit';
import  Redis  from '@upstash/redis';
const cache = new Map()

export const ratelimit = new Ratelimit({
  redis: Redis.fromEnv(),
  limiter: Ratelimit.slidingWindow(5, '10 s'),
  ephemeralCache: cache,
  analytics:true
});
fahreddinozcan commented 2 months ago

Hey, can you try import { Redis } from '@upstash/redis'. I'd suggest removing and readding the dependency, restarting the TS server, reloading the window -if you're using vscode- etc. This seems like a problem with the local environment, and there could be various underlying reasons.