使用firebase云函数运行firebase deploy
时,我收到4个错误。
错误来自我没有接触过的文件。
node_modules/firebase-functions/lib/function-builder.d.ts:64:136 - error TS2707: Generic type 'Request<P>' requires between 0 and 1 type arguments.
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/function-builder.d.ts:64:252 - error TS2694: Namespace '"/Users/harrisa/dev/apps/exerciser/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:36 - error TS2707: Generic type 'Request<P>' requires between 0 and 1 type arguments.
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/handler-builder.d.ts:21:152 - error TS2694: Namespace '"/Users/harrisa/dev/apps/exerciser/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;
我尝试过更新firebase函数和firebase管理npm包,但错误仍然存在。
这些错误是在从npm中删除了几个包之后出现的。然而,我将git中的更改恢复到它工作的状态,但错误仍然存在。如有任何帮助,将不胜感激
编辑:
我设法解决了这个问题之后的问题,特别是Adding skipLibCheck to the project's generated functions/tsconfig.json
我仍然认为这只是忽略了问题,但它目前有效。
返回稳定版本。我决定解决这个问题。
"firebase-admin": "8.9.2",
"firebase-functions": "3.3.0",