Closed JustGreg closed 1 year ago
@JustGreg Hi, will look into it asap. if that's the case, we will remove it. thanks for the issue 🔥
@JustGreg Can you share the error you have please?
@danitseitlin thank you for the fast response! here is the type error:
src/adapters/redis.ts(18,5): error TS2322: Type 'import("/builds/projectname/node_modules/redis-modules-sdk/node_modules/ioredis/built/Redis").default' is not assignable to type 'import("/builds/projectname/node_modules/ioredis/built/Redis").default'.
Types of property 'options' are incompatible.
Type 'import("/builds/projectname/node_modules/redis-modules-sdk/node_modules/ioredis/built/redis/RedisOptions").RedisOptions' is not assignable to type 'import("/builds/projectname/node_modules/ioredis/built/redis/RedisOptions").RedisOptions'.
Type 'RedisOptions' is not assignable to type 'CommonRedisOptions'.
Types of property 'Connector' are incompatible.
Type 'import("/builds/projectname/node_modules/redis-modules-sdk/node_modules/ioredis/built/connectors/ConnectorConstructor").default | undefined' is not assignable to type 'import("/builds/projectname/node_modules/ioredis/built/connectors/ConnectorConstructor").default | undefined'.
Type 'import("/builds/projectname/node_modules/redis-modules-sdk/node_modules/ioredis/built/connectors/ConnectorConstructor").default' is not assignable to type 'import("/builds/projectname/node_modules/ioredis/built/connectors/ConnectorConstructor").default'.
Type 'import("/builds/projectname/node_modules/redis-modules-sdk/node_modules/ioredis/built/connectors/AbstractConnector").default' is not assignable to type 'import("/builds/projectname/node_modules/ioredis/built/connectors/AbstractConnector").default'.
Property 'connecting' is protected but type 'AbstractConnector' is not a class derived from 'AbstractConnector'.
I added @types/ioredis (v. 4.28.10) to my project and the error disappeared. Now i removed @types/ioredis again and the error didn't show up again. ¯_(ツ)_/¯
So I took the code you shared and started testing and I couldn't reproduce the issue. I am using dependencies: { "ioredis": "5.2.3", "redis-modules-sdk": "1.3.4", "typescript": "4.2.3" }
I ran tsc on the file and it doesn't seem to throw the error you are talking about. Can you share what version of TS + redis-modules-sdk you're using?
I'm sorry, i can't reproduce this issue either. I think you can close this issue?
@JustGreg All good! happy we looked into it anyways :) If you have any questions, feel free to open issues and discussions. Happy weekend ✌🏼
I think there is no need for
@types/ioredis
ioredis contains build in typescript declerations@types/ioredis
is used with version 4.28.10ioredis
is used with version 5.2.3This cause an error on my project when i want to do something like this: