googleapis/nodejs-googleapis-common

Differing versions of google-auth-library

SebastianEdwards opened this issue ยท 7 comments

Differing versions of google-auth-library between googleapis (1.6.0) and googleapis-common (1.4.0) leads to TypeScript error.

Argument of type '{ auth: OAuth2Client; }' is not assignable to parameter of type 'GlobalOptions'.
  Types of property 'auth' are incompatible.
    Type 'OAuth2Client' is not assignable to type 'string | OAuth2Client'.
      Type 'import("/Users/sebastianedwards/Code/uprise/node_modules/google-auth-library/build/src/auth/oauth2client").OAuth2Client' is not assignable to type 'import("/Users/sebastianedwards/Code/uprise/node_modules/googleapis-common/node_modules/google-auth-library/build/src/auth/oauth2client").OAuth2Client'.
        Types have separate declarations of a private property 'redirectUri'.

The latest version of the googleapis module (v33) uses google-auth-library@1.6.0 now, so this should be all cleared up. Can you try the latest version and see if you're still running into issues?

Can you also share the code you're using to get this compilation error? Thanks!

Sorry, I should have clarified - this issue is the result of upgrading to googleapis@33.0.0.

While googleapis@33.0.0 uses google-auth-library@1.6.0 it now also depends on this library which in turn depends on google-auth-library@1.4.0. The differences between these two versions causes the incompatibility error.

๐Ÿคฆโ€โ™‚๏ธ

@SebastianEdwards I just cut a release with the fix - could you give this a try?

Thanks @JustinBeckwith - the new release has solved the problem ๐Ÿ‘

Hi guys, looks like the issue came back

In my case:

  • googleapis: 34.0.0
  • google-auth-library: 1.6.1
TS2345: Argument of type 'import("C:/path/to/node_modules/googleapis/node_modules/google-auth-library/build/src/auth/oauth2client").OAuth2Client' is not assignable to parameter of type 'import("C:/path/to/node_modules/google-auth-library/build/src/auth/oauth2client").OAuth2Client'.
  Types have separate declarations of a private property 'redirectUri'.

Looks like the problem has surfaced again. And there is a major version diff -


google-auth-library --> ^3.0.0 (from googleapis@39)

google-auth-library --> ^6.1.6 (latest google-auth-library)


Lowering the google-auth-library version to v3.0.0 solved the issue for now ๐Ÿ‘๐Ÿฝ