firebase-functions: Class 'UserRecordMetadata' incorrectly implements interface 'UserMetadata'.

Related issues

None that I know of.

[REQUIRED] Version info

node:

v14.1.0

firebase-functions:

3.6.1

firebase-tools:

8.2.0

[REQUIRED] Test case

tsc

[REQUIRED] Steps to reproduce

Just compiling my app with latest version.

[REQUIRED] Expected behavior

No error.

[REQUIRED] Actual behavior

node_modules/firebase-functions/lib/providers/auth.d.ts:14:22 - error TS2420: Class 'UserRecordMetadata' incorrectly implements interface 'UserMetadata'.
  Property 'lastRefreshTime' is missing in type 'UserRecordMetadata' but required in type 'UserMetadata'.

14 export declare class UserRecordMetadata implements firebase.auth.UserMetadata {
                        ~~~~~~~~~~~~~~~~~~

  node_modules/firebase-admin/lib/auth.d.ts:28:5
    28     lastRefreshTime: string|null;
           ~~~~~~~~~~~~~~~
    'lastRefreshTime' is declared here.

Were you able to successfully deploy your functions?

tsconfig.json:

"skipLibCheck": true,

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 42
  • Comments: 25

Commits related to this issue

Most upvoted comments

This is literally been the cause of headache for me for the past day or so. Everything works with versions:

"firebase-admin": "^8.6.0",
"firebase-functions": "^3.3.0",

but the moment I upgrade to the latest versions:

"firebase-admin": "^8.11.0",
"firebase-functions": "^3.6.1",

errors like these appear:

node_modules/firebase-functions/lib/apps.d.ts:33:21 - error TS7033: Property 'firebaseArgs' implicitly has type 'any', because its get accessor lacks a return type annotation.

33         private get firebaseArgs();
                       ~~~~~~~~~~~~

node_modules/firebase-functions/lib/function-builder.d.ts:64:252 - error TS2694: Namespace '"/home/raveesh/Development/kittygo/chachi-firebase/functions/node_modules/@types/express-serve-static-core/index"' has no exported member 'Query'.

64         onCall: (handler: (data: any, context: https.CallableContext) => any) => import("./cloud-functions").TriggerAnnotated & ((req: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("express-serve-static-core").Query>, resp: express.Response<any>) => void) & import("./cloud-functions").Runnable<any>;
                                                                                                                                                                                                                                                              ~~~~~                                                                                            

node_modules/firebase-functions/lib/handler-builder.d.ts:21:152 - error TS2694: Namespace '"/home/raveesh/Development/kittygo/chachi-firebase/functions/node_modules/@types/express-serve-static-core/index"' has no exported member 'Query'.

21         onRequest: (handler: (req: express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("express-serve-static-core").Query>, resp: express.Response<any>) => void) => HttpsFunction;
                                                                                                                                                          ~~~~~                                                                           

node_modules/firebase-functions/lib/providers/auth.d.ts:14:22 - error TS2420: Class 'UserRecordMetadata' incorrectly implements interface 'UserMetadata'.
  Property 'lastRefreshTime' is missing in type 'UserRecordMetadata' but required in type 'UserMetadata'.

14 export declare class UserRecordMetadata implements firebase.auth.UserMetadata {
                        ~~~~~~~~~~~~~~~~~~

  node_modules/firebase-admin/lib/auth.d.ts:28:5
    28     lastRefreshTime: string|null;
           ~~~~~~~~~~~~~~~
    'lastRefreshTime' is declared here.

node_modules/firebase-functions/node_modules/@types/express/index.d.ts:98:128 - error TS2694: Namespace '"/home/raveesh/Development/kittygo/chachi-firebase/functions/node_modules/@types/express-serve-static-core/index"' has no exported member 'Query'.

98     interface ErrorRequestHandler<P extends core.Params = core.ParamsDictionary, ResBody = any, ReqBody = any, ReqQuery = core.Query>
                                                                                                                                  ~~~~~                                                                                                   

node_modules/firebase-functions/node_modules/@types/express/index.d.ts:99:17 - error TS2707: Generic type 'ErrorRequestHandler' requires between 0 and 1 type arguments.

99         extends core.ErrorRequestHandler<P, ResBody, ReqBody, ReqQuery> { }
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/firebase-functions/node_modules/@types/express/index.d.ts:108:116 - error TS2694: Namespace '"/home/raveesh/Development/kittygo/chachi-firebase/functions/node_modules/@types/express-serve-static-core/index"' has no exported member 'Query'.

108     interface Request<P extends core.Params = core.ParamsDictionary, ResBody = any, ReqBody = any, ReqQuery = core.Query> extends core.Request<P, ResBody, ReqBody, ReqQuery> { }
                                                                                                                       ~~~~~                                                                                                              

node_modules/firebase-functions/node_modules/@types/express/index.d.ts:108:131 - error TS2707: Generic type 'Request<P>' requires between 0 and 1 type arguments.

108     interface Request<P extends core.Params = core.ParamsDictionary, ResBody = any, ReqBody = any, ReqQuery = core.Query> extends core.Request<P, ResBody, ReqBody, ReqQuery> { }
                                                                                                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                         

node_modules/firebase-functions/node_modules/@types/express/index.d.ts:109:123 - error TS2694: Namespace '"/home/raveesh/Development/kittygo/chachi-firebase/functions/node_modules/@types/express-serve-static-core/index"' has no exported member 'Query'.

109     interface RequestHandler<P extends core.Params = core.ParamsDictionary, ResBody = any, ReqBody = any, ReqQuery = core.Query> extends core.RequestHandler<P, ResBody, ReqBody, ReqQuery> { }
                                                                                                                              ~~~~~

node_modules/firebase-functions/node_modules/@types/express/index.d.ts:109:138 - error TS2707: Generic type 'RequestHandler<P>' requires between 0 and 1 type arguments.

109     interface RequestHandler<P extends core.Params = core.ParamsDictionary, ResBody = any, ReqBody = any, ReqQuery = core.Query> extends core.RequestHandler<P, ResBody, ReqBody, ReqQuery> { }
                                                                                                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/firebase-functions/node_modules/@types/express/index.d.ts:111:54 - error TS2315: Type 'Response' is not generic.

111     export interface Response<ResBody = any> extends core.Response<ResBody> { }
                                                         ~~~~~~~~~~~~~~~~~~~~~~


Found 11 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: `tsc`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/raveesh/.npm/_logs/2020-05-07T05_23_43_029Z-debug.log

This is very infuriating 😦

found the issue: “firebase-functions”: “3.6.1” requires “firebase-admin”: “8.11.0”, by default is installing the version ‘8.12.0’.

I just tried with latest dependencies (new firebase version) and skipLibCheck works fine.