Skip to content
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

[ioredis] Unhandled error event: TypeError: net_1.createConnection is not a function #488

Open
devfromfinland opened this issue Jan 11, 2022 · 0 comments

Comments

@devfromfinland
Copy link

Hi, I have setup the graphql server as instructed, and have redis server running in the background. For the front-end, I use React with Typescript, and init the connection when the app is loaded as below.

const REDIS_DOMAIN_NAME = 'localhost';
const REDIS_PORT = 6379;

const options = {
  host: REDIS_DOMAIN_NAME,
  port: REDIS_PORT,
  retryStrategy: (times: number) => Math.min(times * 50, 2000),
};

const pubsub = new RedisPubSub({
  publisher: new Redis(options),
  subscriber: new Redis(options),
});

function App(): JSX.Element {
  return (
    // app component
  )
}

However, some errors were logged in the console.

[ioredis] Unhandled error event: TypeError: net_1.createConnection is not a function
    at http://localhost:3000/static/js/vendors~main.chunk.js:64650:33
    at Item.push.../node_modules/process/browser.js.Item.run (http://localhost:3000/static/js/vendors~main.chunk.js:78287:12)
    at drainQueue (http://localhost:3000/static/js/vendors~main.chunk.js:78251:34)

Did I do something wrong? or is it actually a bug? I have installed ioredis v4.28.2, @type/ioredis v4.28.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant