Closed Patrick386 closed 4 months ago
It seems like you might have missed a value in the initialization of firebase to your app, check your initialize.app function once
It seems like you might have missed a value in the initialization of firebase to your app, check your initialize.app function once
This app was working fine until the upgrade. I haven't made any changes related to initialization, and all values are properly set. Thank you.
I just upgraded dependencies and encountered the same errors. Any ideas on how to fix this?
[i] [Firebase] api & services initialization
Error: Expected a value of type 'String', but got one of type 'Null'
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 294:3 throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 127:3 castError
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 818:12 cast
dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 674:17 as
dart-sdk/lib/_internal/js_shared/lib/js_util_patch.dart 81:5 getProperty
packages/firebase_core_web/firebase_core_web.dart 35:26 _createFromJsOptions
packages/firebase_core_web/firebase_core_web.dart 27:39 _createFromJsApp
packages/firebase_core_web/src/firebase_core_web.dart 322:12 initializeApp
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50 <fn>
dart-sdk/lib/async/zone.dart 1661:54 runUnary
dart-sdk/lib/async/future_impl.dart 162:18 handleValue
dart-sdk/lib/async/future_impl.dart 846:44 handleValueCallback
dart-sdk/lib/async/future_impl.dart 875:13 _propagateToListeners
dart-sdk/lib/async/future_impl.dart 647:5 [_completeWithValue]
dart-sdk/lib/async/future.dart 529:22 <fn>
dart-sdk/lib/async/zone.dart 1661:54 runUnary
dart-sdk/lib/async/future_impl.dart 162:18 handleValue
dart-sdk/lib/async/future_impl.dart 846:44 handleValueCallback
dart-sdk/lib/async/future_impl.dart 875:13 _propagateToListeners
dart-sdk/lib/async/future_impl.dart 464:9 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 181:7 <fn>
Thanks for reporting I'm having a look
I have the same issue on the web. I tried to downgrade the Flutter version - this not helped
I have the same issue
+1
The issue is attributed to something in firebase_core_web
2.11.0. Likely the js_interop
migration. It looks like this is already being addressed in https://github.com/firebase/flutterfire/pull/12239
FEAT(firestore,web): migrate web to js_interop to be compatible with WASM ([#12169](https://github.com/firebase/flutterfire/issues/12169)). ([57ebd529](https://github.com/firebase/flutterfire/commit/57ebd529de5def2bab1557a1bd9967ee4267c08a))
FEAT(auth,web): migrate web to js_interop to be compatible with WASM ([#12145](https://github.com/firebase/flutterfire/issues/12145)). ([8d2df7a1](https://github.com/firebase/flutterfire/commit/8d2df7a1b2198797e9c95c45efaf21b4e5bfe766))
FEAT(core,web): migrate web to js_interop to be compatible with WASM ([#12031](https://github.com/firebase/flutterfire/issues/12031)). ([96f79d21](https://github.com/firebase/flutterfire/commit/96f79d21f51712769f33a601e4564b90d4a60a33))
In the meantime, here is a workaround solution until this gets resolved. You need to explicitly pin firebase_core_web
via a dependency override to the previous version.
dependency_overrides:
firebase_core_web: 2.10.0
Workaround
The issue looks to be attributed to something in the
firebase_core_web
2.11.0. Likely thejs_interop
migration. It looks like this is already being addressed in #12239FEAT(firestore,web): migrate web to js_interop to be compatible with WASM ([#12169](https://github.com/firebase/flutterfire/issues/12169)). ([57ebd529](https://github.com/firebase/flutterfire/commit/57ebd529de5def2bab1557a1bd9967ee4267c08a)) FEAT(auth,web): migrate web to js_interop to be compatible with WASM ([#12145](https://github.com/firebase/flutterfire/issues/12145)). ([8d2df7a1](https://github.com/firebase/flutterfire/commit/8d2df7a1b2198797e9c95c45efaf21b4e5bfe766)) FEAT(core,web): migrate web to js_interop to be compatible with WASM ([#12031](https://github.com/firebase/flutterfire/issues/12031)). ([96f79d21](https://github.com/firebase/flutterfire/commit/96f79d21f51712769f33a601e4564b90d4a60a33))
In the meantime, here is a workaround solution until this gets resolved. You need to explicitly pin
firebase_core_web
via a dependency override.pubspec.yaml
dependency_overrides: firebase_core_web: 2.10.0
It works for me!!!
Same here
Faced the same problem.
In the error message you can find this:
packages/firebase_core_web/firebase_core_web.dart 35:26 _createFromJsOptions
If you don't have Realtime Database configured parameter databaseURL
will be ommited in the firebase_config.dart
. So quick solution would just adding it.
... = FirebaseOptions(
...
databaseURL: '',
);
Hello, does anyone know what could be causing this? I tried to do what was mentioned above, but nothing. I created projects from scratch again to install FlutterFire, and everything seems okay, but when I run it, it gives me that error.
Hello, does anyone know what could be causing this? I tried to do what was mentioned above, but nothing. I created projects from scratch again to install FlutterFire, and everything seems okay, but when I run it, it gives me that error.
As mentioned in comments above, there is two alternative solutions.
Either override firebase_core_web
dependency like this
dependency_overrides:
firebase_core_web: 2.10.0
Or
Faced the same problem.
In the error message you can find this:
packages/firebase_core_web/firebase_core_web.dart 35:26 _createFromJsOptions
If you don't have Realtime Database configured parameter
databaseURL
will be ommited in thefirebase_config.dart
. So quick solution would just adding it.... = FirebaseOptions( ... databaseURL: '', );
Faced the same problem.
In the error message you can find this:
packages/firebase_core_web/firebase_core_web.dart 35:26 _createFromJsOptions
If you don't have Realtime Database configured parameter
databaseURL
will be ommited in thefirebase_config.dart
. So quick solution would just adding it.... = FirebaseOptions( ... databaseURL: '', );
Not working, in my case. Received much more errors :)
dependency_overrides: firebase_core_web: 2.10.0
Not working both solutions. The first one throws me error about type 'AppJsImpl'.
I tried both methods. With the dependency override workaround I got some more unrelated weird errors. The other workaround with the databaseUrl
as an empty string prevents the error but our Firebase (Google) auth stops working.
dependency_overrides:
firebase_core_web: 2.10.0
firebase_auth_web: 5.8.13
cloud_firestore_web: 3.9.0
worked for me. or you can rollback to firebase_core: 2.24.2
dependency_overrides: firebase_core_web: 2.10.0 firebase_auth_web: 5.8.13 cloud_firestore_web: 3.9.0
worked for me. or you can rollback to firebase_core: 2.24.2
It's like an avalanche, one thing leads to another, doesn't work for me. Now throws errors in firebase_messaging_web-3.6.0/lib/src/interop/messaging.dart
../../../../../.pub-cache/hosted/pub.dev/firebase_messaging_web-3.6.0/lib/src/interop/messaging.dart:87:42: Error: 'JSError' isn't a type.
final errorWrapper = allowInterop((JSError e) {
^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/firebase_messaging_web-3.6.0/lib/src/interop/messaging.dart:94:59: Error: Type 'invalid-type' is not a valid type for external `dart:js_interop` APIs. The only valid types are: @staticInterop types, JS types from `dart:js_interop`, void, bool, num, double, int, String, and any extension type that erases to one of these types.
Use one of the valid types instead.
next: nextWrapper.toJS, error: errorWrapper.toJS));
^
../../../../../.pub-cache/hosted/pub.dev/firebase_messaging_web-3.6.0/lib/src/interop/messaging_interop.dart:17:26: Error: Type 'AppJsImpl?' is not a valid type for external `dart:js_interop` APIs. The only valid types are: @staticInterop types, JS types from `dart:js_interop`, void, bool, num, double, int, String, and any extension type that erases to one of these types.
- 'AppJsImpl' is from 'package:firebase_core_web/src/interop/app_interop.dart' ('../../../../../.pub-cache/hosted/pub.dev/firebase_core_web-2.10.0/lib/src/interop/app_interop.dart').
Use one of the valid types instead.
external MessagingJsImpl getMessaging([AppJsImpl? app]);
^
Failed to compile application.
Not resolved in the update 2.25.1
Not resolved in the update 2.25.1
not working for me either
I'm not seeing any issue on my side with the fix. Do you care to give me a sample project? Thanks
I'm not seeing any issue on my side with the fix. Do you care to give me a sample project? Thanks
https://github.com/isrgold/issue12237
simplest example
I tried with this but was unable to replicate the originally reported error. I ran using latest stable 3.16.9.
Moreover, tried running auth and core plugin examples with different combinations of dependencies as mentioned in above comments running on web, although I didn't again see the originally reported error. I came across errors as mentioned in other issues filed today pointing to web.
https://github.com/firebase/flutterfire/issues/12242 https://github.com/firebase/flutterfire/issues/12238 https://github.com/firebase/flutterfire/issues/12235 https://github.com/firebase/flutterfire/issues/12248
/cc @Lyokone
Не решено в обновлении 2.25.1
Same (( 😥😥
dependency_overrides: firebase_core_web: 2.10.0 firebase_auth_web: 5.8.13 cloud_firestore_web: 3.9.0
работал у меня. или вы можете вернуться к firebase_core: 2.24.2
it works in debug mode, but it doesn't work in release. The application starts, but shows a white screen
I see that I have closed the issue. Does it work now? What should I do to fix it?
@SergeyLomow I'm still having the same issue. Here is the versions of the plugins that I'm usying: firebase_core_platform_interface: ^5.0.0 firebase_core_web: ^2.11.2 firebase_core: ^2.25.2 firebase_analytics: ^10.8.3 firebase_crashlytics: ^3.4.12 firebase_messaging: ^14.7.13 cloud_firestore: ^4.15.2 firebase_auth: ^4.17.2 cloud_functions: ^4.6.3
[√] Flutter (Channel stable, 3.16.9, on Microsoft Windows [versÆo 10.0.22621.3007], locale pt-BR) • Flutter version 3.16.9 on channel stable at C:\Users\wantr\Dev\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 41456452f2 (7 days ago), 2024-01-25 10:06:23 -0800 • Engine revision f40e976bed • Dart version 3.2.6 • DevTools version 2.28.5
@SergeyLomow I'm still having the same issue. Here is the versions of the plugins that I'm usying: firebase_core_platform_interface: ^5.0.0 firebase_core_web: ^2.11.2 firebase_core: ^2.25.2 firebase_analytics: ^10.8.3 firebase_crashlytics: ^3.4.12 firebase_messaging: ^14.7.13 cloud_firestore: ^4.15.2 firebase_auth: ^4.17.2 cloud_functions: ^4.6.3
[√] Flutter (Channel stable, 3.16.9, on Microsoft Windows [versÆo 10.0.22621.3007], locale pt-BR) • Flutter version 3.16.9 on channel stable at C:\Users\wantr\Dev\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 41456452f2 (7 days ago), 2024-01-25 10:06:23 -0800 • Engine revision f40e976bed • Dart version 3.2.6 • DevTools version 2.28.5
Does it work for you in the release version?
@SergeyLomow I'm still having the same issue. Here is the versions of the plugins that I'm usying: firebase_core_platform_interface: ^5.0.0 firebase_core_web: ^2.11.2 firebase_core: ^2.25.2 firebase_analytics: ^10.8.3 firebase_crashlytics: ^3.4.12 firebase_messaging: ^14.7.13 cloud_firestore: ^4.15.2 firebase_auth: ^4.17.2 cloud_functions: ^4.6.3
[√] Flutter (Channel stable, 3.16.9, on Microsoft Windows [versÆo 10.0.22621.3007], locale pt-BR) • Flutter version 3.16.9 on channel stable at C:\Users\wantr\Dev\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 41456452f2 (7 days ago), 2024-01-25 10:06:23 -0800 • Engine revision f40e976bed • Dart version 3.2.6 • DevTools version 2.28.5
And are these plugins listed in dependency_overrides?
Not resolved in the update 2.25.2
Not resolved in the update 2.25.2
Add empty databaseURL: '',
Not resolved in the update 2.25.2
Add empty databaseURL: '',
Does not work in the release version, white screen
After adding an empty databaseURL option I can start the app on the web, but now I get another error
Expected a value of type 'DateTime?', but got one of type 'LegacyJavaScriptObject'
@SergeyLomow I'm still having the same issue. Here is the versions of the plugins that I'm usying: firebase_core_platform_interface: ^5.0.0 firebase_core_web: ^2.11.2 firebase_core: ^2.25.2 firebase_analytics: ^10.8.3 firebase_crashlytics: ^3.4.12 firebase_messaging: ^14.7.13 cloud_firestore: ^4.15.2 firebase_auth: ^4.17.2 cloud_functions: ^4.6.3 [√] Flutter (Channel stable, 3.16.9, on Microsoft Windows [versÆo 10.0.22621.3007], locale pt-BR) • Flutter version 3.16.9 on channel stable at C:\Users\wantr\Dev\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 41456452f2 (7 days ago), 2024-01-25 10:06:23 -0800 • Engine revision f40e976bed • Dart version 3.2.6 • DevTools version 2.28.5
Add databaseURL
static const FirebaseOptions web = FirebaseOptions( ... databaseURL: '', );
my pubspec.yaml
# -> Firebase firebase_core: ^2.25.1 firebase_auth: ^4.17.2 firebase_storage: ^11.6.2 firebase_remote_config: ^4.3.11 firebase_messaging: ^14.7.12 firebase_crashlytics: ^3.4.12 firebase_analytics: ^10.8.3 cloud_functions: ^4.6.3 cloud_firestore: ^4.15.1
I did it, it works in debug mode
After adding an empty databaseURL option I can start the app on the web, but now I get another error
Expected a value of type 'DateTime?', but got one of type 'LegacyJavaScriptObject'
have you tried running in release??
I'm sorry, it looks like I started it incorrectly. I did it like this, flutter run -d chrome --release
Works. I'm trying to roll it out to firebase hosting right now
... = FirebaseOptions( ... databaseURL: '', );
This worked for me.. Good job.!
... = FirebaseOptions( ... databaseURL: '', );
This work for me only in release mode. In debug i have the same error as before.
... = FirebaseOptions( ... databaseURL: '', );
This worked for me.. Good job.!
This worked for me too!!!!!!! Adding the override that was suggested at the start did more wrong than good. Such a fast fix after a day and a half of research!
is it working when you build a apk?
try building apk it will not work
normal firebase web hosting deploy is working, but haven't checked apk yet. Don't want to freak out more for today ahaha
just go all in:
databaseURL:'',
measurementId:'',
trackingId:'',
deepLinkURLScheme:'',
androidClientId:'',
iosClientId:'',
iosBundleId:'',
appGroupId: '',
Error: Web
static const FirebaseOptions web = FirebaseOptions(
apiKey: 'AIzaSxxxxxxxxxxxxxxxxxxxxxxxY',
authDomain: 'xxxxxxxx386.firebaseapp.com',
projectId: 'xxxxxxxxxx386',
storageBucket: 'xxxxxxxxxxxxxxxx.appspot.com',
measurementId: 'G-Vxxxxxxxxxxx',
appId: '1:637854794218:web:984cxxxxxxxxxxxxxxxxxxxxx',
messagingSenderId: '637xxxxxxxxxx',
);
It requires filling unnecessary parts for it to work on the web app. That seems to be the cause. More precisely, if 'databaseURL' is null, an error occurs.
static const FirebaseOptions web = FirebaseOptions(
apiKey: 'AIzaSxxxxxxxxxxxxxxxxxxxxxxxY',
authDomain: 'xxxxxxxx386.firebaseapp.com',
projectId: 'xxxxxxxxxx386',
storageBucket: 'xxxxxxxxxxxxxxxx.appspot.com',
measurementId: 'G-Vxxxxxxxxxxx',
appId: '1:xxxxxxxxx:web:984cxxxxxxxxxxxxxxxxxxxxx',
messagingSenderId: '637xxxxxxxxxx',
/// Add
databaseURL:'',
trackingId:'',
deepLinkURLScheme:'',
androidClientId:'',
iosClientId:'',
iosBundleId:'',
appGroupId: '',
);
This is what worked for me now, without the overrides it doesnt. I am testing on Chrome only:
dependencies:
flutter:
sdk: flutter
firebase_core: ^2.25.2
cloud_firestore: ^4.15.2
dependency_overrides:
firebase_core_web: 2.10.0
firebase_auth_web: 5.8.13
cloud_firestore_web: 3.9.0
It seems like you might have missed a value in the initialization of firebase to your app, check your initialize.app function once
This app was working fine until the upgrade. I haven't made any changes related to initialization, and all values are properly set. Thank you.
Did the issue get solved ? if yes how did you solve
Esto es lo que funcionó para mí ahora, sin las anulaciones que no tiene. Estoy probando solo en Chrome:
dependencies: flutter: sdk: flutter firebase_core: ^2.25.2 cloud_firestore: ^4.15.2 dependency_overrides: firebase_core_web: 2.10.0 firebase_auth_web: 5.8.13 cloud_firestore_web: 3.9.0
The problem had disappeared on its own for me, but I think it reappeared when I reimported Cloud Firestore. However, with this solution, it worked perfectly the first time around
I'm still having the issue. None of the mentioned above fixes resolved it for me.
good day programmers. please i have this error when i tried running my project through the web after flutter upgrade.
Error: The argument type 'JSPromise Function(dynamic)' can't be assigned to the parameter type 'PromiseJsImpl
can anyone help me out with a solution
After upgrading to Flutter version 3.16.9, I'm encountering errors, and I'm unable to identify the cause.
cloud_firestore_platform_interface: ^6.1.0 firebase_core_platform_interface: ^5.0.0 firebase_storage: ^11.6.0
firebase_auth: ^4.16.0 firebase_ui_auth: ^1.12.1 firebase_auth_web: ^5.8.13
Flutter doctor