-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default Import Error with ioredis Prevents TypeScript Compilation with esModuleInterop Disabled #129
Comments
That error goes away but don't you get other errors instead? I don't think IORedis typings are fully following the modern TS standard for exporting classes so I am not sure what can be done other than enabling the |
I created a PR as a proof of concept. Yes, I did encounter some other errors when I disabled esModuleInterop in BullMQ. I addressed those in the PR as well. It seems people have had this issue before with ioredis (redis/ioredis#712) and TypeScript in general (microsoft/TypeScript#28009). I am not sure if my change is conventional. It does fix my problem though. Do you have any thoughts? |
@bobdercole I have the same issue here, and your patch is correct, aside from the comments from @manast about using the type only, when appropriate. |
🎉 This issue has been resolved in version 1.8.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hello,
My TypeScript projects fails to compile due to an error in some BullMQ files. Here is the error:
I found this problem in the following files:
bullmq/src/classes/redis-connection.ts
Line 2 in 36726bf
bullmq/src/commands/index.ts
Line 15 in 36726bf
bullmq/src/interfaces/queue-options.ts
Line 3 in 36726bf
bullmq/src/interfaces/redis-options.ts
Line 1 in 36726bf
bullmq/src/utils.ts
Line 1 in 36726bf
bullmq/src/test/test_queue.ts
Line 5 in 36726bf
I do have
esModuleInterop
disabled. The issues seems to go away if I enabledesModuleInterop
. However, I don't think that this flag should be required.I can confirm that the error goes away if the ioredis imports within BullMQ are changed to the recommended ioredis usage:
import * as Redis from "ioredis";
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/946a98e60e6ae4f4f2910f1c75b8403e0f676876/types/ioredis/index.d.ts#L21
Any thoughts? Thanks!
The text was updated successfully, but these errors were encountered: