moaxaca / async-redis

First class async & promise support for redis.
Other
168 stars 21 forks source link

Typescript compiler imports index.d.ts instead of index.js #59

Open Vaidaz opened 3 years ago

Vaidaz commented 3 years ago

Hi!

Thanks for a great module! :blush:

Since version 2.0.0 async-redis is no longer working with typescript. it seems like tsc is loading src/index.d.ts file instead of src/index.js.

Reproducible steps:

  1. create a new project
  2. create index.ts
  3. install async-redis
  4. write this line of code: import { createClient } from 'async-redis';
  5. compile index.ts: tsc index.ts

I am using typescript 4.3.2 version.

amitozalvo commented 3 years ago

Also need this

joeldn commented 3 years ago

Seems like the types that are shipped with the packages are missing a lot of essential type declarations. Only way I got it to work for now (I know it's ugly) is to install the @types/async-redis package and add a post-install hook to my package.json scripts that removes the types that are shipped with the package (like so "postinstall": "rimraf ./node_modules/async-redis/src/index.d.ts"). This way the types from @types/async-redis are loaded instead, which at least makes it workable in a TS project.

tamis-laan commented 2 years ago

Even with @types/async-redis not working for me: screenshot But I'm transpiling javascript code with tsc

slaveofcode commented 2 years ago

Any update on this?

jamesopti commented 2 years ago

This is biting us now and is quite frustrating. Any updates?

dylanh724 commented 2 years ago

Is this project still alive? Any forks going on?