MarcelRobitaille / bbyen

Bring Back YouTube Email Notifications! YouTube upload email notification replacement
MIT License
10 stars 0 forks source link

[error] [main]: Cannot read property 'client_id' of undefined #3

Closed derolly closed 3 years ago

derolly commented 4 years ago

When trying to start the application I always get the error: [error] [main]: Cannot read property 'client_id' of undefined

My google-credentials.json looks like this:

{
    "web": {
        "client_id": "...",
        "project_id": "...",
        "auth_uri": "https://accounts.google.com/o/oauth2/auth",
        "token_uri": "https://oauth2.googleapis.com/token",
        "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
        "client_secret": "..."
    }
}

What do I miss?

Edit: I followed the instructions in you readme exactly and I'm using node version 14.15.0

wampxs commented 3 years ago

I am having the exact same problem.

MarcelRobitaille commented 3 years ago

This is a problem with your google-credentials.json. If you download the wrong file, it has "web" where it should have "installed".

My credentials looks like this:

{ "installed": {
    "client_id": ....,
    "project_id": ....,
    "auth_uri": ....,
    "token_uri": ....,
    "auth_provider_x509_cert_url": ....,
    "client_secret": .....,
    "redirect"uris": [...],
} }

I forget exactly why google sometimes gives "installed" and sometimes "web". The latter might be for running in browser if I had to guess. You could try changing "web" with "installed" in the config file and if that doesn't work try to download a credentials file with "installed" in it.

wampxs commented 3 years ago

So, this sorts it. By default, the credential page prompts to make it a Web App, to get the "installed" .json you have to set it as a computer app. Maybe specify that in the guide.

MarcelRobitaille commented 3 years ago

I forget actually. Is it # 2? image

Since you just went through the steps, would you make a pull request?