RPC instantly disconnecting

I'm currently trying to create a RPC client inside of a Nuxt application and run it client-side, but whatever I try the connection is instantly closed with just a connection closed error. I'm not sure if what I'm trying to do just isn't feasible or what I would be missing exactly Here's what I'm trying to use currently:
import RPC from 'discord-rpc';

const client = new RPC.Client({ transport: 'ipc' });
const scopes = ['identify', 'rpc', 'rpc.voice.read', 'rpc.voice.write', 'guilds']

await client.login({
clientID: "<client id>",
scopes: scopes
}).catch((err) => {
console.log("Login err: ".concat(err));
});
import RPC from 'discord-rpc';

const client = new RPC.Client({ transport: 'ipc' });
const scopes = ['identify', 'rpc', 'rpc.voice.read', 'rpc.voice.write', 'guilds']

await client.login({
clientID: "<client id>",
scopes: scopes
}).catch((err) => {
console.log("Login err: ".concat(err));
});
1 Reply
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Want results from more Discord servers?
Add your server