SrWither / DiscordBSD

an attempt at a native discord client for FreeBSD
BSD 3-Clause "New" or "Revised" License
47 stars 5 forks source link

Problem with RPC #12

Open memL0rz opened 3 months ago

memL0rz commented 3 months ago

Hi,

First of all, thank you for this Discord client.

My problem: I have been trying for days to get RPC running, but it doesn't seem to work.

I tried building it from source, but I encountered this error (I've never touched JS before):

npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated gar@1.0.4: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated npmlog@6.0.2: This package is no longer supported.
npm WARN deprecated rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated are-we-there-yet@3.0.1: This package is no longer supported.
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm WARN deprecated asar@3.2.0: Please use @electron/asar moving forward.  There is no API change, just a package name change
npm WARN deprecated gauge@4.0.4: This package is no longer supported.
npm ERR! code 1
npm ERR! path /home/fabian/repos/rpc/DiscordBSD/node_modules/electron
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! HTTPError: Response code 404 (Not Found)
npm ERR!     at Request._onResponseBase (/home/fabian/repos/rpc/DiscordBSD/node_modules/got/dist/source/core/index.js:913:31)
npm ERR!     at Request._onResponse (/home/fabian/repos/rpc/DiscordBSD/node_modules/got/dist/source/core/index.js:948:24)
npm ERR!     at ClientRequest.<anonymous> (/home/fabian/repos/rpc/DiscordBSD/node_modules/got/dist/source/core/index.js:962:23)
npm ERR!     at Object.onceWrapper (node:events:632:26)
npm ERR!     at ClientRequest.emit (node:events:529:35)
npm ERR!     at origin.emit (/home/fabian/repos/rpc/DiscordBSD/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
npm ERR!     at HTTPParser.parserOnIncomingClient (node:_http_client:700:27)
npm ERR!     at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
npm ERR!     at TLSSocket.socketOnData (node:_http_client:541:22)
npm ERR!     at TLSSocket.emit (node:events:517:28)

npm ERR! A complete log of this run can be found in: /home/fabian/.npm/_logs/2024-06-20T16_55_17_878Z-debug-0.log

uname -r:

14.1-RELEASE

Then I downloaded the binary (0.0.54), and it worked, but RPC did not.

It would be really cool if you could help me out.

Best regards, Fab1anDev

SrWither commented 3 months ago

I have tried compiling and running and I have had no problems, I am going to see what happens from a virtual machine from 0

memL0rz commented 3 months ago

I have tried compiling and running and I have had no problems, I am going to see what happens from a virtual machine from 0

Thanks for the reply. Yeah that would be nice. It looks like a connection is established and started correctly. Here are the Logs from Discord:

[arRPC] arRPC v3.1.0
(node:1643) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
[arRPC > bridge] listening on 1337
[arRPC > ipc] listening at /var/run/xdg/fabian/discord-ipc-0
[arRPC > websocket] listening on 6463
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
[1644:0623/232759.295780:ERROR:interface_endpoint_client.cc(702)] Message 6 rejected by interface blink.mojom.WidgetHost
[1644:0623/232759.295806:ERROR:interface_endpoint_client.cc(702)] Message 7 rejected by interface blink.mojom.WidgetHost
(node:1644) UnhandledPromiseRejectionWarning: Error: An object could not be cloned.
    at t.ipcRendererInternal.send (node:electron/js2c/renderer_init:2:10956)
    at EventEmitter.<anonymous> (node:electron/js2c/renderer_init:2:10428)
(Use `DiscordBSD --trace-warnings ...` to show where the warning was created)
(node:1644) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
[arRPC > bridge] web connected
SrWither commented 3 months ago

It seems that the problem is in the operation of the ARRPC bookstore that is responsible for making that part work. Very possibly there was a change in some commitment

memL0rz commented 3 months ago

i really dont have experience with JS but i tried just for fun to run Discord without RPC and i think the Discord client is the problem itself:

.local/bin/discord
node:internal/modules/cjs/loader:1148
  throw err;
  ^

Error: Cannot find module '/home/fabian/.local/share/discordbsd/RPC/src'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.14.0
(node:21372) UnhandledPromiseRejectionWarning: Error: An object could not be cloned.
    at IpcRendererInternal.send (node:electron/js2c/renderer_init:2:11234)
    at IpcRendererInternal.<anonymous> (node:electron/js2c/renderer_init:2:10729)
(Use `DiscordBSD --trace-warnings ...` to show where the warning was created)
(node:21372) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
memL0rz commented 3 months ago

Which RPC Plugin do you use for NeoVim? it also possible the RPC Plugin is broken. i mean the arRPC is running

SrWither commented 3 months ago

The problem is not the plugin, since I tried running arrpc by hand and running it from discord web and it also failed there Very possibly discord has made some change that causes arrpc to fail