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

Library fails with "this.auth.getUniverseDomain is not a function" #1557

Closed
Rochet2 opened this issue Feb 7, 2024 · 6 comments · Fixed by #1559
Closed

Library fails with "this.auth.getUniverseDomain is not a function" #1557

Rochet2 opened this issue Feb 7, 2024 · 6 comments · Fixed by #1559
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@Rochet2
Copy link
Contributor

Rochet2 commented Feb 7, 2024

  1. Is this a client library issue or a product issue?
    It is a client library dependency issue. Gax depends on features that exist on newer version than what is installed.

  2. Did someone already solve this?

Did not find any issues by searching with getUniverseDomain.

  1. Do you have a support contract?
    Please create an issue in the support console to ensure a timely response.
    If the support paths suggested above still do not result in a resolution, please provide the following details.

Environment details

  • OS:
  • Node.js version 18.17:
  • npm version: 9.4.0
    "node_modules/google-gax": {
      "version": "4.3.0",
      "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-4.3.0.tgz",
      "integrity": "sha512-SWHX72gbccNfpPoeTkNmZJxmLyKWeLr0+5Ch6qtrf4oAN8KFXnyXe5EixatILnJWufM3L59MRZ4hSJWVJ3IQqw==",
      "dependencies": {
        "@grpc/grpc-js": "~1.9.6",
        "@grpc/proto-loader": "^0.7.0",
        "@types/long": "^4.0.0",
        "abort-controller": "^3.0.0",
        "duplexify": "^4.0.0",
        "google-auth-library": "^9.0.0",
        "node-fetch": "^2.6.1",
        "object-hash": "^3.0.0",
        "proto3-json-serializer": "^2.0.0",
        "protobufjs": "7.2.6",
        "retry-request": "^7.0.0",
        "uuid": "^9.0.1"
      },
      "engines": {
        "node": ">=14"
      }
    },

Steps to reproduce

  1. Install "@google-cloud/pubsub": "4.3.0"
  2. Try using it and it will error with this.auth.getUniverseDomain is not a function
  3. Observe that google-gax depends on "google-auth-library": "^9.0.0", but getUniverseDomain was introduced in v9.3.0 here. We have google-auth-library: "9.0.0" installed.
@Rochet2 Rochet2 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 7, 2024
@Rochet2
Copy link
Contributor Author

Rochet2 commented Feb 7, 2024

Issue originates from #1552 which added the dependency to the newer version of google-auth-library.

And to clarify, people will want to verify that their package-lock.json does not have
google-auth-library version < 9.3.0 AND google-gax version 4.3.0 or newer at the same time.

@sofisl
Copy link
Contributor

sofisl commented Feb 7, 2024

Hi @Rochet2, if you delete your package-lock.json and reinstall dependencies, you should pull in the latest version of the auth library.

@Rochet2
Copy link
Contributor Author

Rochet2 commented Feb 7, 2024

I can do that, but it is not necessarily viable long term fix and does not address the larger problem. I am not the only one that will run into the issue.

Doesn't gax have a way to control its own dependencies so they would work with the library?
I see the package file does not list any dependencies in the repository.

@Rochet2
Copy link
Contributor Author

Rochet2 commented Feb 7, 2024

Looks like this is the correct place to edit

"google-auth-library": "^9.0.0",

@lucasvickers
Copy link

I'm still seeing this issue using the following:

@google-cloud/[email protected]
[email protected]
[email protected]

I've skimmed my package-lock.json to confirm no sub dependencies are pulling in old library versions.

@rbatista191
Copy link

I keep on having this issue as well 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants