async-redis icon indicating copy to clipboard operation
async-redis copied to clipboard

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

Open Vaidaz opened this issue 4 years ago • 6 comments

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.

Vaidaz avatar Jun 14 '21 19:06 Vaidaz

Also need this

amitozalvo avatar Aug 30 '21 10:08 amitozalvo

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.

joeldn avatar Sep 28 '21 13:09 joeldn

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

tamis-laan avatar Nov 28 '21 20:11 tamis-laan

Any update on this?

slaveofcode avatar Jan 13 '22 02:01 slaveofcode

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

jamesopti avatar Aug 05 '22 01:08 jamesopti

Is this project still alive? Any forks going on?

dylanh724 avatar Oct 24 '22 13:10 dylanh724