Unsupported operation: default Security Context getter at Object.throw_ [as throw] (http://localhost:51147/dart_sdk.js:5080:11)
at mongo_dart._ConnectionManager.new.open (http://localhost:51147/packages/mongo_dart/src/database/utils/split_hosts.dart.lib.js:11102:23)at open.throw ()
Related
I was working on a flutter web app and a power outage broke my firebase options.
Here is the error I get:
Running "flutter pub get" in flutter_tools...
Launching lib\main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
DartUri: Unresolved uri: dart:web_sql
DartUri: Unresolved uri: dart:ui
This app is linked to the debug service: ws://127.0.0.1:52488/knxO4BrQ_6M=/ws
Debug service listening on ws://127.0.0.1:52488/knxO4BrQ_6M=/ws
Running with sound null safety
Debug service listening on ws://127.0.0.1:52488/knxO4BrQ_6M=/ws
Error: Assertion failed:
file:///C:/Users/niema/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core_web-1.7.3/lib/src/firebase_core_web.dart:207:11
options != null
"FirebaseOptions cannot be null when creating the default app."
at Object.throw_ [as throw] (http://localhost:52440/dart_sdk.js:5069:11)
at Object.assertFailed (http://localhost:52440/dart_sdk.js:4994:15)
at firebase_core_web.FirebaseCoreWeb.new.initializeApp (http://localhost:52440/packages/firebase_core_web/firebase_core_web.dart.lib.js:226:42)
at initializeApp.next (<anonymous>)
at http://localhost:52440/dart_sdk.js:40627:33
at _RootZone.runUnary (http://localhost:52440/dart_sdk.js:40497:59)
at _FutureListener.thenAwait.handleValue (http://localhost:52440/dart_sdk.js:35424:29)
at handleValueCallback (http://localhost:52440/dart_sdk.js:35985:49)
at _Future._propagateToListeners (http://localhost:52440/dart_sdk.js:36023:17)
at [_completeWithValue] (http://localhost:52440/dart_sdk.js:35858:23)
at http://localhost:52440/dart_sdk.js:35063:46
at _RootZone.runUnary (http://localhost:52440/dart_sdk.js:40497:59)
at _FutureListener.then.handleValue (http://localhost:52440/dart_sdk.js:35424:29)
at handleValueCallback (http://localhost:52440/dart_sdk.js:35985:49)
at _Future._propagateToListeners (http://localhost:52440/dart_sdk.js:36023:17)
at [_completeWithValue] (http://localhost:52440/dart_sdk.js:35858:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:52440/dart_sdk.js:35892:35)
at Object._microtaskLoop (http://localhost:52440/dart_sdk.js:40764:13)
at _startMicrotaskLoop (http://localhost:52440/dart_sdk.js:40770:13)
at http://localhost:52440/dart_sdk.js:36247:9
Here is what I have tried to fix it:
deleted pubspec.lock because it gave some long binary error of 001001
ran a flutter clean and flutter pub get
deleted pub cache in flutter folder
deleted cache folder located in C:/Users/niema/AppData/Local/Pub
cloned the project again from github
Run flutter channel stable
Run flutter upgrade
Replace await Firebase.initializeApp() with await Firebase.initializeApp( options: const FirebaseOptions( apiKey: "XXX", appId: "XXX", messagingSenderId: "XXX", projectId: "XXX", ), );
Restart the app.
Or if that doesn't work, there's another thread that treats the same error here: https://stackoverflow.com/a/70234018/7156819
Hello I am getting flutter firebase web error.
I initialized web properly but I am getting this error when I try to use firebase Firestore functions.
I have no idea about this error ....
Is there anyone who has this error before ?
Thangs for reading.
FirebaseError: Firebase: firebase.firestore() takes either no argument or a Firebase App instance.
(app/invalid-app-argument).
at Object.e [as firestore] (https://www.gstatic.com/firebasejs/8.10.1/firebase-app.js:1:19409)
at Object.getFirestoreInstance
(http://localhost:5000/packages/cloud_firestore_web/src/interop/utils/utils.dart.lib.js:1226:79)
at get [_delegate] (http://localhost:5000/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:778:59)
at cloud_firestore_web.FirebaseFirestoreWeb.new.doc
(http://localhost:5000/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:811:76)
at cloud_firestore.FirebaseFirestore.__.doc
(http://localhost:5000/packages/cloud_firestore/cloud_firestore.dart.lib.js:1456:84)
at database_service.DataBaseServcie.new.read
(http://localhost:5000/packages/root/img_files/img_slider.dart.lib.js:5997:65)
at read.next (<anonymous>)
at runBody (http://localhost:5000/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:5000/dart_sdk.js:40691:7)
at database_service.DataBaseServcie.new.read
(http://localhost:5000/packages/root/img_files/img_slider.dart.lib.js:5992:20)
at http://localhost:5000/packages/timetowork/screen/posting/posting_main_screen.dart.lib.js:15869:44
at [_handleTap] (http://localhost:5000/packages/flutter/src/material/icon_button.dart.lib.js:42254:31)
at tap.TapGestureRecognizer.new.invokeCallback
(http://localhost:5000/packages/flutter/src/gestures/recognizer.dart.lib.js:198:18)
at tap.TapGestureRecognizer.new.handleTapUp
(http://localhost:5000/packages/flutter/src/gestures/tap.dart.lib.js:411:42)
at [_checkUp] (http://localhost:5000/packages/flutter/src/gestures/tap.dart.lib.js:217:12)
at tap.TapGestureRecognizer.new.handlePrimaryPointer
(http://localhost:5000/packages/flutter/src/gestures/tap.dart.lib.js:166:23)
at tap.TapGestureRecognizer.new.handleEvent
(http://localhost:5000/packages/flutter/src/gestures/recognizer.dart.lib.js:444:16)
at [_dispatch] (http://localhost:5000/packages/flutter/src/gestures/pointer_router.dart.lib.js:86:9)
at http://localhost:5000/packages/flutter/src/gestures/pointer_router.dart.lib.js:112:26
at LinkedMap.new.forEach (http://localhost:5000/dart_sdk.js:27745:11)
at [_dispatchEventToRoutes]
(http://localhost:5000/packages/flutter/src/gestures/pointer_router.dart.lib.js:110:29)
at pointer_router.PointerRouter.new.route
(http://localhost:5000/packages/flutter/src/gestures/pointer_router.dart.lib.js:105:37)
at binding$5.WidgetsFlutterBinding.new.handleEvent
(http://localhost:5000/packages/flutter/src/gestures/binding.dart.lib.js:367:26)
at binding$5.WidgetsFlutterBinding.new.dispatchEvent
(http://localhost:5000/packages/flutter/src/gestures/binding.dart.lib.js:355:24)
at binding$5.WidgetsFlutterBinding.new.dispatchEvent
(http://localhost:5000/packages/flutter/src/rendering/layer.dart.lib.js:5440:13)
at [_handlePointerEventImmediately]
(http://localhost:5000/packages/flutter/src/gestures/binding.dart.lib.js:331:14)
at binding$5.WidgetsFlutterBinding.new.handlePointerEvent
(http://localhost:5000/packages/flutter/src/gestures/binding.dart.lib.js:305:43)
at [_flushPointerEventQueue] (http://localhost:5000/packages/flutter/src/gestures/binding.dart.lib.js:295:14)
at [_handlePointerDataPacket] (http://localhost:5000/packages/flutter/src/gestures/binding.dart.lib.js:286:54)
at Object.invoke1 (http://localhost:5000/dart_sdk.js:191747:7)
at _engine.EnginePlatformDispatcher.__.invokeOnPointerDataPacket (http://localhost:5000/dart_sdk.js:171943:15)
at [_onPointerData] (http://localhost:5000/dart_sdk.js:172879:49)
at http://localhost:5000/dart_sdk.js:173317:28
at http://localhost:5000/dart_sdk.js:173273:16
at loggedHandler (http://localhost:5000/dart_sdk.js:172978:11)
run flutter pub upgrade --major-versions
run dart fix --apply
Try upgrading your packages at:
firebase_core: ^1.20.0
cloud_firestore: ^3.4.2
then flutter clean / flutter pub get
I am using dart.io package and trying to detect the current locate of the system using Platform.localeName like this
WidgetsFlutterBinding.ensureInitialized();
String defaultSystemLocale = Platform.localeName;
print('$defaultSystemLocale');
But when I run the app in Chrome (Web), I am getting this error
Error: Unsupported operation: Platform._localeName
at Object.throw_ [as throw] (http://localhost:62284/dart_sdk.js:5061:11)
at Function._localeName (http://localhost:62284/dart_sdk.js:54692:17)
at Function.localeName (http://localhost:62284/dart_sdk.js:54698:71)
at Function.get localeName [as localeName] (http://localhost:62284/dart_sdk.js:54574:27)
at main (http://localhost:62284/packages/testapp/main4.dart.lib.js:97:45)
Any idea why?
If you are getting Platform from dart:io, it is not supported on web (see this website). You can import it from universal_io instead.
I am trying to integrate Google pay into my app using web intent plugin. After I completed the install I got the following error:
ERROR TypeError: Object(...) is not a function at WebIntent.get [as
ACTION_VIEW]
Click here for my error
Sir, I am trying to run file using protractor cucumber framework by using
async and await concept it passes all my tests but it always gives error
regarding angular testability and I don't know why it gives such a type of
error, please read the code below once and help me to figure out where I am
wrong in this approach.
Please refer below my feature file :-
Please refer my pageobjects file as below :-
Please refer step-definition file as below:-
Please refer configuration file conf.ts as below :-
Please refer console logs as below:-
[12:31:48] I/launcher - Running 1 instances of WebDriver
[12:31:48] I/direct - Using ChromeDriver directly...
DevTools listening on ws://127.0.0.1:54978/devtools/browser/3cec07ae-0398-49b1-8fd9-36607b210799
...Menu 9 option reached
..
1 scenario (1 passed)
4 steps (4 passed)
0m00.034s
(node:2484) UnhandledPromiseRejectionWarning: Error: Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined. This could be either because this is a
non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. See http://git.io/v4gXM for details"
at runWaitForAngularScript.then (E:\Backup_work\Protractor projects\cucumber2_framework\node_modules\protractor\built\browser.js:463:23)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)Error
at ElementArrayFinder.applyAction_ (E:\Backup_work\Protractor projects\cucumber2_framework\node_modules\protractor\built\element.js:459:27)
at ElementArrayFinder.(anonymous function).args [as click] (E:\Backup_work\Protractor projects\cucumber2_framework\node_modules\protractor\built\element.js:91:29)
at ElementFinder.(anonymous function).args [as click] (E:\Backup_work\Protractor projects\cucumber2_framework\node_modules\protractor\built\element.js:831:22)
at homepageclass.clickEXWmenu (E:\Backup_work\Protractor projects\cucumber2_framework\pageobjects\menu9.PO.js:10:29)
at World.<anonymous> (E:\Backup_work\Protractor projects\cucumber2_framework\Stepdefinition\first.steps.js:22:20)
at Generator.next (<anonymous>)
at E:\Backup_work\Protractor projects\cucumber2_framework\Stepdefinition\first.steps.js:7:71
at new Promise (<anonymous>)
at __awaiter (E:\Backup_work\Protractor projects\cucumber2_framework\Stepdefinition\first.steps.js:3:12)
at World.<anonymous> (E:\Backup_work\Protractor projects\cucumber2_framework\Stepdefinition\first.steps.js:21:12)
(node:2484) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2484) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:2484) UnhandledPromiseRejectionWarning: Error: Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined. This could be either because this is a
non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. See https://github.com/angular/protractor/issues/2643 for details"
at runWaitForAngularScript.then (E:\Backup_work\Protractor projects\cucumber2_framework\node_modules\protractor\built\browser.js:463:23)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)Error
at ElementArrayFinder.applyAction_ (E:\Backup_work\Protractor projects\cucumber2_framework\node_modules\protractor\built\element.js:459:27)
at ElementArrayFinder.(anonymous function).args [as click] (E:\Backup_work\Protractor projects\cucumber2_framework\node_modules\protractor\built\element.js:91:29)
at ElementFinder.(anonymous function).args [as click] (E:\Backup_work\Protractor projects\cucumber2_framework\node_modules\protractor\built\element.js:831:22)
at homepageclass.clickmenu9 (E:\Backup_work\Protractor projects\cucumber2_framework\pageobjects\menu9.PO.js:13:26)
at World.<anonymous> (E:\Backup_work\Protractor projects\cucumber2_framework\Stepdefinition\first.steps.js:26:10)
(node:2484) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
[12:31:50] I/launcher - 0 instance(s) of WebDriver still running
[12:31:50] I/launcher - chrome #01 passed
Your first problem here is you are using await but the function you are using await on is not async.
public async clickEXWMenu(){
await this.EXWenquirymenu.click();
}
This is how it should be ^