You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At try to run any typescript compilation; I share with you a tiny example from my unit test code
My test script with Mocha
importfirebaseFunctionsTestfrom'firebase-functions-test';describe('onCreateUser',()=>{before(()=>{firebaseFunctionsTest();});it('Hello world',async()=>{// Test stuff});});
The tsc returns the follow error messages, as you can see all of them are from firebase-functions-test definition files.
node_modules/firebase-functions-test/lib/main.d.ts:1:44 - error TS2305: Module '"firebase-functions"' has no exported member 'HttpsFunction'.
1 import { CloudFunction as CloudFunctionV1, HttpsFunction, Runnable } from 'firebase-functions';
~~~~~~~~~~~~~
node_modules/firebase-functions-test/lib/main.d.ts:1:59 - error TS2305: Module '"firebase-functions"' has no exported member 'Runnable'.
1 import { CloudFunction as CloudFunctionV1, HttpsFunction, Runnable } from 'firebase-functions';
~~~~~~~~
node_modules/firebase-functions-test/lib/main.d.ts:10:64 - error TS2344: Type 'T' does not satisfy the constraint 'CloudEvent<unknown>'.
10 export declare function wrap<T>(cloudFunction: CloudFunctionV1<T>): WrappedScheduledFunction | WrappedFunction<T>;
~
node_modules/firebase-functions-test/lib/main.d.ts:10:30
10 export declare function wrap<T>(cloudFunction: CloudFunctionV1<T>): WrappedScheduledFunction | WrappedFunction<T>;
~
This type parameter might need an `extends CloudEvent<unknown>` constraint.
node_modules/firebase-functions-test/lib/providers/analytics.d.ts:1:10 - error TS2305: Module '"firebase-functions"' has no exported member 'analytics'.
1 import { analytics } from 'firebase-functions';
~~~~~~~~~
node_modules/firebase-functions-test/lib/providers/auth.d.ts:1:10 - error TS2305: Module '"firebase-functions"' has no exported member 'auth'.
1 import { auth } from 'firebase-functions';
~~~~
node_modules/firebase-functions-test/lib/providers/pubsub.d.ts:11:5 - error TS2314: Generic type 'Message<T>' requires 1 type argument(s).
11 }): pubsub.Message;
~~~~~~~~~~~~~~
node_modules/firebase-functions-test/lib/providers/pubsub.d.ts:19:5 - error TS2314: Generic type 'Message<T>' requires 1 type argument(s).
19 }): pubsub.Message;
~~~~~~~~~~~~~~
node_modules/firebase-functions-test/lib/providers/pubsub.d.ts:21:43 - error TS2314: Generic type 'Message<T>' requires 1 type argument(s).
21 export declare function exampleMessage(): pubsub.Message;
~~~~~~~~~~~~~~
node_modules/firebase-functions-test/lib/providers/storage.d.ts:7:13 - error TS2694: Namespace '"C:/Users/RaulMendoza/Documents/JS/gasto-smart/functions/node_modules/firebase-functions/lib/v2/providers/storage"' has no exported member 'ObjectMetadata'.
7 }): storage.ObjectMetadata;
~~~~~~~~~~~~~~
node_modules/firebase-functions-test/lib/providers/storage.d.ts:9:58 - error TS2694: Namespace '"C:/Users/RaulMendoza/Documents/JS/gasto-smart/functions/node_modules/firebase-functions/lib/v2/providers/storage"' has no exported member 'ObjectMetadata'.
9 export declare function exampleObjectMetadata(): storage.ObjectMetadata;
~~~~~~~~~~~~~~
node_modules/firebase-functions-test/lib/v1.d.ts:1:25 - error TS2305: Module '"firebase-functions"' has no exported member 'HttpsFunction'.
1 import { Change, https, HttpsFunction, Runnable } from 'firebase-functions';
~~~~~~~~~~~~~
node_modules/firebase-functions-test/lib/v1.d.ts:1:40 - error TS2305: Module '"firebase-functions"' has no exported member 'Runnable'.
1 import { Change, https, HttpsFunction, Runnable } from 'firebase-functions';
The text was updated successfully, but these errors were encountered:
wazzu3000
changed the title
It is not possible compile from typescript
It is not possible compile to typescript
Dec 10, 2024
I think you could just update the imports from firebase-functions used into .d.ts files according the lastest firebase-functions version. This should fix the issue.
Version info
firebase-functions-test: 3.3.0
firebase-functions: 6.1.1
firebase-admin: 12.1.0
typescript: 4.9.0
Test case
At try to run any typescript compilation; I share with you a tiny example from my unit test code
My test script with Mocha
tsconfig.json file
Steps to reproduce
tsc
Expected behavior
The compilation should finish without errors
Actual behavior
The tsc returns the follow error messages, as you can see all of them are from
firebase-functions-test
definition files.The text was updated successfully, but these errors were encountered: