Issue with importing ioredis
See original GitHub issueThe example code used in section Creating the Redis Client of the readme has the following import:
import * as Redis from 'ioredis';
This results in an error message:
publisher: new Redis(options),
^
TypeError: Redis is not a constructor
To fix this, you simply need to change the import to:
import Redis from 'ioredis';
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:5 (2 by maintainers)
Top Results From Across the Web
issues after upgrading ioredis to v5.0.1 - Stack Overflow
Our original code to create redis clients import Redis, { Redis as RedisClient, Cluster, ClusterOptions } from 'ioredis'; import config from ...
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 >Redis with Node.js (ioredis) | Redis Documentation Center
The following sections demonstrate the use of ioredis, a community-recommended Redis client for Node.js with build-in support for promises.
Read more >How to use the ioredis.Cluster function in ioredis - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately. Enable here. github lawrips /...
Read more >liaoliaots/nestjs-redis-health - NPM Package Overview
Redis(ioredis) health checks module for Nest framework (node.js). ... Dependencies have 1 critical issue. Install scripts ...
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
try to import it like this
const Redis = require('ioredis')
commonjs likeThanks TheEhsanSarshar . It’s work well for me!!