Reputation: 25
I tried downgrading my flutter, happens on every version I tried. Downgraded my firebase_core and firebase_auth dependencies, still same problem. Installed fedora on my other drive just to make sure I didn't mess anything on my main system, still happens there as well.
Even if I don't run with debug mode and just use flutter run, using any sign in or sign out function will freeze the app since Firebase.initializeApp doesn't initialize.
Flutter doctor doesn't show any problems.
main.dart:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
runApp(const MainApp());
}
Firebase.initializeApp, throws this exception:
Exception has occurred. "Error: Expected a value of type 'Object', but got one of type 'Null' dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 288:49 throw dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 121:3 castError dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 529:12 cast dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 78:24
as packages/firebase_core_web/src/firebase_core_web.dart 87:20
get [_ignoredServiceScripts] packages/firebase_core_web/src/firebase_core_web.dart 163:28
_initializeCore dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54
runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async packages/firebase_core_web/src/firebase_core_web.dart 155:31
[_initializeCore] packages/firebase_core_web/src/firebase_core_web.dart 197:11
initializeApp dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54
runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async packages/firebase_core_web/src/firebase_core_web.dart 193:44
initializeApp packages/firebase_core/src/firebase.dart 43:47
initializeApp dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54
runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async packages/firebase_core/src/firebase.dart 39:43 initializeApp dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54
runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
web_entrypoint.dart 24:31
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 367:37 _checkAndCall dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 372:39 dcall lib/ui/initialization.dart 77:15
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50 dart-sdk/lib/async/zone.dart 1661:54
runUnary dart-sdk/lib/async/future_impl.dart 147:18
handleValue dart-sdk/lib/async/future_impl.dart 784:44
handleValueCallback dart-sdk/lib/async/future_impl.dart 813:13
_propagateToListeners dart-sdk/lib/async/future_impl.dart 584:5 [_completeWithValue] dart-sdk/lib/async/future_impl.dart 657:7
callback dart-sdk/lib/async/schedule_microtask.dart 40:11
_microtaskLoop dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 177:15
"
Upvotes: 0
Views: 176
Reputation: 1
If you're using VS Code, check if you have "All Exceptions" checked off under the breakpoints section. I had this same problem and unchecking it fixed it for me.
Upvotes: 0