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

client.connect() struck for the easiest sample #2842

Open
syheliel opened this issue Sep 21, 2024 · 3 comments
Open

client.connect() struck for the easiest sample #2842

syheliel opened this issue Sep 21, 2024 · 3 comments
Labels

Comments

@syheliel
Copy link

Description

The following code is from README.md, I run it by node main.js

import { createClient } from 'redis';

const client = createClient();

client.on('error', err => console.log('Redis Client Error', err));

await client.connect();

And I start redis by

docker run -p 6379:6379 -it redis/redis-stack-server:latest

I can confirm that I can connect the server using redis-cli, But I can't do it in nodejs. Do I miss some essential operation to make it run?

Node.js Version

20.16.0

Redis Server Version

latest

Node Redis Version

4.7.0

Platform

Linux

Logs

No response

@syheliel syheliel added the Bug label Sep 21, 2024
@sjpotter
Copy link
Contributor

i don't see anything obviusly wrong, and the basic structure works for me, something else must be going on.

@syheliel
Copy link
Author

I can reproduce the error on my other machine. Do you have some idea to get further information for debugging?

@sjpotter
Copy link
Contributor

does it just hang? for instance, if I try to do it without a redis-server running on localhost:6379, I get a repeated error of

Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379

which makes sense.

to not get that error, would imply that its "connecting", but stuck somewhere, which makes little sense to me.

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

No branches or pull requests

2 participants