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

@google-cloud/logging-winston (intermediate value).GoogleAuth is not a constructor (vuejs) #789

Open
patrickchho opened this issue Mar 20, 2023 · 1 comment
Assignees
Labels
api: logging Issues related to the googleapis/nodejs-logging-winston API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@patrickchho
Copy link

I am trying to add @google-cloud/logging-winston to my VueJS project. I followed these https://www.npmjs.com/package/@google-cloud/logging-winston and https://cloud.google.com/logging/docs/samples/logging-winston-quickstart very closely.

I am getting:

TypeError: (intermediate value) (intermediate value) (intermediate value).GoogleAuth is not a constructor
     at new Logging(index.js ? 221c: 137: 1)
     at new LoggingCommon(common.js ? bc26 : 94: 1)
     at new LoggingWinston(index.js ? 1856 : 113: 1)

Here's my code:

const winston = require('winston');

const {LoggingWinston} = require('@google-cloud/logging-winston');

// error here
const gcloudWinston = new LoggingWinston();

I traced the flow of code from new LoggingWinston() --> new LoggingCommon() --> new Logging() and found this line from the @google-cloud/logging library:

this.auth = new (gaxInstance !== null && gaxInstance !== void 0 ? gaxInstance : gax).GoogleAuth(options_);

Screen Shot 2023-03-19 at 11 27 51 PM copy

Question: How do I get new LoggingWinston() to work for my project?

PS: My dependencies are up-to-date:


  "dependencies": {
    "@google-cloud/logging-winston": "^5.3.0",
    "google-gax": "^3.5.8",
    "googleapis": "^113.0.0",
    "node": "^18.15.0",
    "node-polyfill-webpack-plugin": "^2.0.1",
    "vue": "^2.7.14",
...
  },
@patrickchho patrickchho added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Mar 20, 2023
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/nodejs-logging-winston API. label Mar 20, 2023
@losalex losalex removed their assignment Jul 3, 2023
@cindy-peng
Copy link
Contributor

Hi @patrickchho, you will need to set up authentications correctly for logging: https://cloud.google.com/docs/authentication/provide-credentials-adc

Could you share more details about the authentication set up in your application?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/nodejs-logging-winston API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants