Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: No access, refresh token or API key is set. #276

Open
subhojit-cn opened this issue Nov 25, 2019 · 5 comments
Open

Error: No access, refresh token or API key is set. #276

subhojit-cn opened this issue Nov 25, 2019 · 5 comments

Comments

@subhojit-cn
Copy link

When I try to build the simple angular app with guess js. It's giving me the error.

My "extend.webpack.config.js" is like below:

const { GuessPlugin } = require('guess-webpack');
const { parseRoutes } = require('guess-parser');

module.exports = {
  plugins: [
    new GuessPlugin({
        GA: '', //ga code is not here because for security reason
        routeProvider() {
            return parseRoutes('.');
        },
        runtime: {
            delegate: false
        }
    })
  ]
};

The build error is like that.

cn4s-MacBook-Pro:guess-angular cn4$ npm run build

> guess-angular@0.0.0 build /Users/cn4/Documents/subhojit/practice/guess-js/guess-angular
> ng build

95% emitting GuessPluginError: No access, refresh token or API key is set.
    at OAuth2Client.getRequestMetadataAsync (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/google-auth-library/build/src/auth/oauth2client.js:249:19)
    at OAuth2Client.requestAsync (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/google-auth-library/build/src/auth/oauth2client.js:337:34)
    at OAuth2Client.request (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/google-auth-library/build/src/auth/oauth2client.js:331:25)
    at createAPIRequestAsync (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/googleapis-common/build/src/apirequest.js:248:27)
    at Object.createAPIRequest (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/googleapis-common/build/src/apirequest.js:44:9)
    at Resource$Reports.batchGet (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/googleapis/build/src/apis/analyticsreporting/v4.js:80:37)
    at /Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:6740
    at new Promise (<anonymous>)
    at /Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:6703
    at /Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:5610
    at Object.next (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:5715)
    at /Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:4627
    at new Promise (<anonymous>)
    at r (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:4372)
    at s (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:6634)
    at /Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:7578
(node:1185) UnhandledPromiseRejectionWarning: Error: No access, refresh token or API key is set.
    at OAuth2Client.getRequestMetadataAsync (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/google-auth-library/build/src/auth/oauth2client.js:249:19)
    at OAuth2Client.requestAsync (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/google-auth-library/build/src/auth/oauth2client.js:337:34)
    at OAuth2Client.request (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/google-auth-library/build/src/auth/oauth2client.js:331:25)
    at createAPIRequestAsync (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/googleapis-common/build/src/apirequest.js:248:27)
    at Object.createAPIRequest (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/googleapis-common/build/src/apirequest.js:44:9)
    at Resource$Reports.batchGet (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/googleapis/build/src/apis/analyticsreporting/v4.js:80:37)
    at /Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:6740
    at new Promise (<anonymous>)
    at /Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:6703
    at /Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:5610
    at Object.next (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:5715)
    at /Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:4627
    at new Promise (<anonymous>)
    at r (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:4372)
    at s (/Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:6634)
    at /Users/cn4/Documents/subhojit/practice/guess-js/guess-angular/node_modules/guess-ga/dist/guess-ga/index.js:1:7578
(node:1185) 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(). (rejection id: 3)
(node:1185) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Please help me to resolve this issue.

@mgechev
Copy link
Member

mgechev commented Nov 25, 2019

Do you provide access to your GA report via the OAuth popup?

@subhojit-cn
Copy link
Author

Yes, I gave permission on oAuth popup.

First, a browser opens according to below link screenshot:
https://drive.google.com/file/d/1hkvD85_E2S4QOq9TcOwRDyvp6hWoinzx/view?usp=sharing

Then the permission popup comes and I gave permission and then it redirects in a link and doesn't able to run the server.
https://drive.google.com/file/d/1l8TIQo2WdOIm2SzYpH8Ufqjy9E2iYNHp/view?usp=sharing

Please check and let me know what thing I miss!

@mgechev
Copy link
Member

mgechev commented Nov 27, 2019

First, a browser opens according to below link screenshot:
https://drive.google.com/file/d/1hkvD85_E2S4QOq9TcOwRDyvp6hWoinzx/view?usp=sharing

Here you click on "Go to guess-js (unsafe)", right?

Then the permission popup comes and I gave permission and then it redirects in a link and doesn't able to run the server.
https://drive.google.com/file/d/1l8TIQo2WdOIm2SzYpH8Ufqjy9E2iYNHp/view?usp=sharing

Yes, this looks like the problem. I cannot reproduce the issue locally. Do you have a constraint on opening a port on your machine?

@subhojit-cn
Copy link
Author

Here you click on "Go to guess-js (unsafe)", right?

Yes I did "Go to guess-js (unsafe)"

Yes, this looks like the problem. I cannot reproduce the issue locally. Do you have a constraint on opening a port on your machine?

I am can't able to check that. Can you please let me know how to check on the mac laptop?

Please give me some solution for this so I can implement guess js in my angular projects.

@mgechev
Copy link
Member

mgechev commented Feb 16, 2020

@subhojit-cn you can use the JWT solution from this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants