parro-it / electron-google-oauth

Google api access token in electron
MIT License
56 stars 16 forks source link

BrowserWindow is not a constructor #11

Closed jwir3 closed 8 years ago

jwir3 commented 8 years ago

With the following code:

const result = googleOauth.getAccessToken(
      ['https://www.google.com/m8/feeds'],
      ArbitratorConfig.google_client_id,
      ArbitratorConfig.google_client_secret
    ).then(token => {
                console.log(JSON.stringify(token, null, 2));
                // app.removeListener('will-quit', preventQuit);
                // app.quit();

I am getting the following exception:

index.js:27 Uncaught (in promise) TypeError: BrowserWindow is not a constructor(…)

My current version of electron-google-oauth is 2.0.0.

parro-it commented 8 years ago

Are you running the code in the main or renderer process?

jwir3 commented 8 years ago

Ah, right. Yep, that was the problem. I was trying to run that code from the renderer process. Thanks.