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});
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
Most helpful comment
Have you modified your
web/index.htmlto include the Firebase initialization code, and the Script tag forcloud_functions(and any other firebase libraries you're using on the web)?Check the README of package:cloud_functions_web for more info.