question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem setting this up with Electron

See original GitHub issue

I’m trying to add rich presence to an electron app.

I’ve tried the default code: After accepting discord auth, it redirects to my redirect Url, but not access token, I got this instead : http://localhost:4242/oauth/redirect#error=invalid_scope So I tried removing scopes. I just kept rpc.api scope. This time, I get the token.

But when I try to

client.login(config.clientId, {
        accessToken: token,
        scopes     : config.scopes
});

all I get is

https://i.imgur.com/sgqLe8I.png

Could you help on that ? Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
devsnekcommented, Nov 11, 2017

it has to go in main because its a separate process from renderer. Discord will think that your process has no window and therefore won’t think its a game if its in the renderer

1reaction
Armaldiocommented, Nov 11, 2017

I got it working now. It’s working with nodejs and electron

For anyone in the same case as me, you must put the code inside the main.js file and not the renderer.js file. I still don’t know why, I will try to find more infos. You can still communicate between the main and the renderer process using IPC or any other methods

Read more comments on GitHub >

github_iconTop Results From Across the Web

Requiring electron outside of main.js causes a TypeError #7300
One reason some people are still experiencing this problem is that nodeIntegration has been removed from Electron v12. So setting ...
Read more >
node.js - Electron app.on('ready'... never being called and ...
I found that the error was caused by data being left over in the %AppData%/electron directory, and the %AppData%/[projectname] directory.
Read more >
Don't Use Electron Until You've Read This Article - Medium
The Electron team has worked to address this problem, changing setting defaults to more secure options in recent releases.
Read more >
Things I Wish I Knew Before Working with Electron.js
In this article, I'll share how you can avoid some of the mistakes I made when learning about Electron.js ?‍♂️. I hope it...
Read more >
Advanced Installation Instructions | Electron
To install prebuilt Electron binaries, use npm. The preferred method is to install Electron as a development dependency in your app:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found