ioredis v5 typescript error
See original GitHub issueHi,
I’m using ioredis, upstash and I’ve updated to latest version. My typescript is flagging the instance line with an error:
No overload matches this call.
import Redis from 'ioredis';
const redis = new Redis(process.env.REDIS_CONNECTION_STRING);
export default redis;
where REDIS_CONNECTION_STRING
is following the example on upstash
and rediss://:PASSWORD@REGION-DOMAIN.upstash.io:PORT
I know this is probably an issue with upstash, but can I update my instance to
import Redis from 'ioredis';
const redis = new Redis(PORT, process.env.REDIS_CONNECTION_STRING_WITHOUT_PORT);
export default redis;
Is this the newest way?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Errors from ioredis when compiling typescript code · Issue #1566
When running the tsc command ioredis gives a lot of errors when compiling typescript code. Versions used ioredis -5.0.4 Nodejs - 16.14.0 ...
Read more >ioredis - npm
A robust, performance-focused and full-featured Redis client for Node.js.. Latest version: 5.2.4, last published: 2 months ago.
Read more >issues after upgrading ioredis to v5.0.1 - Stack Overflow
I'm getting a semantic error when I compile the project typescript. xxx/node_modules/@types/connect-redis/index.d.ts(22,51): ...
Read more >IORedis | Ts.ED - A Node.js and TypeScript Framework on top ...
Support classic Redis connection and Cluster connection. Inject connection to another service. Mock connection for unit/integration test. # Installation. npm ...
Read more >Redis with Node.js (ioredis) | Redis Documentation Center
This example shows how to configure ioredis to make a connection to Redis using TLS ... [ioredis] Unhandled error event: ReplyError: NOPERM this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It has to be in uppercase, which is EX. There is a migration guide on the README that mentions this.
process.env.REDIS_CONNECTION_STRING
may be undefined, which will make the statement look like:And there is no overload for this.
Adding an assert fixes the issue.
Having said that seems we can add the support for
new Redis(undefined)
to make everything default. WDYT?