Flutterfire: [cloud_functions_web] this.jsObject.functions is not a function

Created on 7 Feb 2020  路  3Comments  路  Source: FirebaseExtended/flutterfire

I get this error on the web:
app.dart:60 Uncaught (in promise) TypeError: this.jsObject.functions is not a function
at app.App._fromJsObject.functions (app.dart:60)
at cloud_functions_web.CloudFunctionsWeb.new.callCloudFunction (cloud_functions_web.dart:48)
at cloud_functions.HttpsCallable.__.call (https_callable.dart:41)
at sendPushToTopic (utils.dart:252)
at sendPushToTopic.next ()
at runBody (async_patch.dart:86)
at Object._async [as async] (async_patch.dart:125)
at Function.sendPushToTopic (utils.dart:248)
at sendMessageToWorkers (manager_shifts_page.dart:657)
at sendMessageToWorkers.next ()
at onValue (async_patch.dart:47)
at _RootZone.runUnary (zone.dart:1381)
at _FutureListener.thenAwait.handleValue (future_impl.dart:140)
at handleValueCallback (future_impl.dart:682)
at Function._propagateToListeners (future_impl.dart:711)
at _Future.new.[_completeWithValue] (future_impl.dart:526)
at async._AsyncCallbackEntry.new.callback (future_impl.dart:556)
at Object._microtaskLoop (schedule_microtask.dart:43)
at _startMicrotaskLoop (schedule_microtask.dart:52)
at async_patch.dart:168

It happens when calling:
HttpsCallable httpsCallable = CloudFunctions.instance.getHttpsCallable(
functionName: "sendPushToTopic",
);
but sometimes I could pass this call and the same error happened right after that when I call:

HttpsCallableResult httpsCallableResult = await httpsCallable
    .call(<String, dynamic>{"msgType": msgType, 'topic': topic, "text": text, "myData1": myData1, "myData2": myData2});

Most helpful comment

Have you modified your web/index.html to include the Firebase initialization code, and the Script tag for cloud_functions (and any other firebase libraries you're using on the web)?

<script src="https://www.gstatic.com/firebasejs/YOUR_FIREBASE_VERSION/firebase-functions.js"></script>

Check the README of package:cloud_functions_web for more info.

All 3 comments

Have you modified your web/index.html to include the Firebase initialization code, and the Script tag for cloud_functions (and any other firebase libraries you're using on the web)?

<script src="https://www.gstatic.com/firebasejs/YOUR_FIREBASE_VERSION/firebase-functions.js"></script>

Check the README of package:cloud_functions_web for more info.

You're right, sorry. Looks good now, thanks.

Hi @ronytesler
Given your last message I feel safe to close this issue,
if you disagree please write in the comments and I will reopen it.
Thank you

Was this page helpful?
0 / 5 - 0 ratings