Skip to content

Socket.io private chat example outdated #4681

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

Closed
theSmartRed opened this issue Apr 3, 2023 Discussed in #4680 · 9 comments
Closed

Socket.io private chat example outdated #4681

theSmartRed opened this issue Apr 3, 2023 Discussed in #4680 · 9 comments
Labels
documentation Improvements or additions to documentation

Comments

@theSmartRed
Copy link

theSmartRed commented Apr 3, 2023

Discussed in #4680

Originally posted by theSmartRed April 3, 2023
I am trying to run the private chat example following the readme instructions but I see this error trying to install the client side

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @vue/cli-service@undefined
npm ERR! node_modules/@vue/cli-service
npm ERR!   dev @vue/cli-service@"~4.5.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/[email protected]
npm ERR! node_modules/@vue/cli-plugin-babel
npm ERR!   dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

I am using Node 18.15 and NPM 9.5 that are the current LTS versions for both. How to fix?

On the server side trying to run I see:

Node.js v18.15.0
Worker 1737 died
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
Emitted 'error' event on RedisAdapter instance at:
    at Redis.onError (/Users/lelio.faieta/Documents/Sites/private-messaging/server/node_modules/socket.io-redis/dist/index.js:65:22)
    at Redis.emit (node:events:513:28)
    at Redis.silentEmit (/Users/lelio.faieta/Documents/Sites/private-messaging/server/node_modules/ioredis/built/redis/index.js:553:26)
    at Socket.<anonymous> (/Users/lelio.faieta/Documents/Sites/private-messaging/server/node_modules/ioredis/built/redis/event_handler.js:191:14)
    at Object.onceWrapper (node:events:628:26)
    at Socket.emit (node:events:525:35)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -61,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}

this is just an example since it keeps looping on this kind of error


@haneenmahd
Copy link

I will take a look at into this issue 👍 !

@pawanmkr
Copy link

can you provide link to the instructions?

@haneenmahd
Copy link

I could reproduce several issues in the vue project. They are

  • outdated npm packages
  • not supported to the new ssl provider after node v16
  • outdated eslint config

On the server side, it fails to connect to the port 6379 because you aren't running a Redis server. You have run it using the command redis-server. See Stackoverflow

@ErtanTaner
Copy link

Thanks @haneenmahd for the "not supported ..... after node v16" part. I don't have much time and wants to learn about private messaging. Didn't know about the error's cause. I can use it with 16 lts right now 👍 I hope going to fix in the near future.

@haneenmahd
Copy link

I'm gonna take a look into the example and let me do what I can do with it 😊!

@haneenmahd
Copy link

I have opened up a new PR fixing the docs and legacy provider bug. Hope it helps future devs checking out the example. FYI, you can fix the dependency installation by adding a -legacy-peer-deps flag while installing.

@darrachequesne
Copy link
Member

I've bumped the dependencies in cbf0362, it should now work properly on Node.js 18. Could you please check?

@darrachequesne darrachequesne added the documentation Improvements or additions to documentation label May 3, 2023
haneenmahd pushed a commit to haneenmahd/socket.io that referenced this issue May 4, 2023
@haneenmahd
Copy link

@darrachequesne yes, it does work now! the dependencies are up-to-date.

Screenshot 2023-05-04 at 19 38 29

@darrachequesne
Copy link
Member

@haneenmahd awesome, thanks for the feedback 👍

I'm closing this now, please reopen if needed.

dzad pushed a commit to dzad/socket.io that referenced this issue May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants