Pigpog/vlc-discord-rpc

Not connecting to Discord client

Ilovemyhous opened this issue · 10 comments

Describe the bug
Always getting the error,

Failed to connect to Discord. Is your Discord client open? Retrying in 20 seconds.

Yes, the client is running, but not displaying.
I also tried these steps in another this issue, but nothing works.

To Reproduce
Steps to reproduce the behavior:
Simple, launch the script. Doesn't mater if Discord was running or not before.

Terminal output

luxi@Mint-Laptop ~/T/vlc-discord-rpc> sh start.sh

> vlc-discord-rpc@2.2.12 start /home/luxi/Téléchargements/vlc-discord-rpc
> node ./src/app.js

Connecting to Discord...
Failed to connect to Discord. Is your Discord client open? Retrying in 20 seconds...
Connecting to Discord...
Failed to connect to Discord. Is your Discord client open? Retrying in 20 seconds...
Connecting to Discord...
Failed to connect to Discord. Is your Discord client open? Retrying in 20 seconds...
Connecting to Discord...
Failed to connect to Discord. Is your Discord client open? Retrying in 20 seconds...
Connecting to Discord...
Failed to connect to Discord. Is your Discord client open? Retrying in 20 seconds...
Connecting to Discord...
Failed to connect to Discord. Is your Discord client open? Retrying in 20 seconds...
Connecting to Discord...
Failed to connect to Discord. Is your Discord client open? Retrying in 20 seconds...
Connecting to Discord...
Failed to connect to Discord. Is your Discord client open? Retrying in 20 seconds...
^C⏎

Your Setup:
image

luxi@Mint-Laptop ~/T/vlc-discord-rpc> npm version
{ 'vlc-discord-rpc': '2.2.12',
  npm: '6.14.4',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '36.1',
  http_parser: '2.9.3',
  icu: '66.1',
  modules: '64',
  napi: '5',
  nghttp2: '1.40.0',
  node: '10.19.0',
  openssl: '1.1.1d',
  tz: '2021a',
  unicode: '13.0',
  uv: '1.34.2',
  v8: '6.8.275.32-node.55',
  zlib: '1.2.11' }
luxi@Mint-Laptop ~/T/vlc-discord-rpc> npm --version
6.14.4

VLC version: 3.0.9.2 Vetinari
Discord client version:
image

Additional context
I also have Garuda Linux, and Windows (10), if you want to let me test on those

Did you install Discord using Flatpak? If so, no rich presence will ever work for you since Discord is kept in a container. Judging by your neofetch, you're a flatpak user.
Install Discord natively and try again. You might need to install a PPA/repository to get it, or manually use the .deb file provided by discord.com.

The install is from flatpak, I installed it trough the Mint/GNOME store.
image

I'll try with the native version.

So, good and bad news.
The connecting issue is gone, but now I have another issue.
image

I've never seen that issue before, odd. I just tested it on my end (i dont use vlc-discord-rpc regularly anymore) and it still works for me. This is an issue between the discord-rpc module and discord, and in cases like this, a reboot usually fixes it magically

Well, not this time.

luxi@Mint-Laptop ~/T/vlc-discord-rpc> sh start.sh

> vlc-discord-rpc@2.2.12 start /home/luxi/Téléchargements/vlc-discord-rpc
> node ./src/app.js

Connecting to Discord...
An unknown error occurred when connecting to Discord
(node:4345) UnhandledPromiseRejectionWarning: Error: connection closed
    at IPCTransport.transport.once (/home/luxi/Téléchargements/vlc-discord-rpc/node_modules/discord-rpc/src/client.js:118:16)
    at Object.onceWrapper (events.js:286:20)
    at IPCTransport.emit (events.js:198:13)
    at decode (/home/luxi/Téléchargements/vlc-discord-rpc/node_modules/discord-rpc/src/transports/ipc.js:141:18)
    at decode (/home/luxi/Téléchargements/vlc-discord-rpc/node_modules/discord-rpc/src/transports/ipc.js:92:5)
    at Socket.socket.on (/home/luxi/Téléchargements/vlc-discord-rpc/node_modules/discord-rpc/src/transports/ipc.js:120:7)
    at Socket.emit (events.js:198:13)
    at emitReadable_ (_stream_readable.js:555:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:4345) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4345) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

have you made any modifications to the config.js file?

The only thing I changed was the application ID, which I replaced with my user ID, and the theme from vlc to vlcneon.
image

The application ID is not a user ID. It identifies vlc-discord-rpc, and should not be changed unless you create a new Discord Application. Change it back to default and it should work.

PS: pixelation is a bad way to obfuscate text, and it may be possible to uncover the original text. In this case, I don't think it is very sensitive, but just keep it in mind.

Working perfectly!
image

Sorry for that stupid issue with the user ID and the application ID. ^^'

Awesome, glad we were able to figure it out!