once I try to call signInWithPhoneNumber() on flutter web, I get an error:
TypeError: Cannot read properties of undefined (reading 'settings')
at new RecaptchaVerifier (https://www.gstatic.com/firebasejs/9.9.0/firebase-auth.js:8390:43)
at RecaptchaVerifier.new (http://localhost:60687/packages/firebase_auth_web/src/interop/auth.dart.lib.js:863:233)
at new firebase_auth_web_recaptcha_verifier_factory.RecaptchaVerifierFactoryWeb.new (http://localhost:60687/packages/firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart.lib.js:175:49)
at firebase_auth_web_recaptcha_verifier_factory.RecaptchaVerifierFactoryWeb.__.delegateFor (http://localhost:60687/packages/firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart.lib.js:87:14)
at RecaptchaVerifier.new (http://localhost:60687/packages/firebase_auth/firebase_auth.dart.lib.js:643:94)
at auth_service.AuthService.new.signInUp (http://localhost:60687/packages/qew_app/page_models/welcome_page_model.dart.lib.js:12180:98)
at signInUp.next (<anonymous>)
at runBody (http://localhost:60687/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:60687/dart_sdk.js:40691:7)
at auth_service.AuthService.new.signInUp (http://localhost:60687/packages/qew_app/page_models/welcome_page_model.dart.lib.js:12179:20)
at logister_page_model.LogisterPageModel.new.logister (http://localhost:60687/packages/qew_app/page_models/welcome_page_model.dart.lib.js:9060:65)
at logister.next (<anonymous>)
at runBody (http://localhost:60687/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:60687/dart_sdk.js:40691:7)
at logister_page_model.LogisterPageModel.new.logister (http://localhost:60687/packages/qew_app/page_models/welcome_page_model.dart.lib.js:9055:20)
at logister_widgets.PhoneNumberCard.new.<anonymous> (http://localhost:60687/packages/qew_app/page_models/welcome_page_model.dart.lib.js:9318:23)
at logister_widgets._PhoneNumberCardState.new.formSubmit (http://localhost:60687/packages/qew_app/ui/views/pages/logister/logister_widgets.dart.lib.js:1543:12)
at http://localhost:60687/packages/qew_app/ui/views/pages/logister/logister_widgets.dart.lib.js:1547:1021
at [_finalizeEditing] (http://localhost:60687/packages/flutter/src/widgets/title.dart.lib.js:36779:9)
at editable_text.EditableTextState.new.performAction (http://localhost:60687/packages/flutter/src/widgets/title.dart.lib.js:36652:39)
at text_input.TextInput.__._handleTextInputInvocation (http://localhost:60687/packages/flutter/src/services/text_formatter.dart.lib.js:2373:66)
at _handleTextInputInvocation.next (<anonymous>)
at runBody (http://localhost:60687/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:60687/dart_sdk.js:40691:7)
at [_handleTextInputInvocation] (http://localhost:60687/packages/flutter/src/services/text_formatter.dart.lib.js:2288:20)
at OptionalMethodChannel._handleAsMethodCall (http://localhost:60687/packages/flutter/src/services/restoration.dart.lib.js:1599:57)
at _handleAsMethodCall.next (<anonymous>)
at runBody (http://localhost:60687/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:60687/dart_sdk.js:40691:7)
at [_handleAsMethodCall] (http://localhost:60687/packages/flutter/src/services/restoration.dart.lib.js:1596:20)
at http://localhost:60687/packages/flutter/src/services/restoration.dart.lib.js:1593:126
at http://localhost:60687/packages/flutter/src/services/restoration.dart.lib.js:6148:31
at Generator.next (<anonymous>)
at runBody (http://localhost:60687/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:60687/dart_sdk.js:40691:7)
at http://localhost:60687/packages/flutter/src/services/restoration.dart.lib.js:6145:82
at Object.invoke2 (http://localhost:60687/dart_sdk.js:191758:7)
at ui._ChannelCallbackRecord.new.invoke (http://localhost:60687/dart_sdk.js:133047:15)
at ui._Channel.new.push (http://localhost:60687/dart_sdk.js:133118:54)
at ui.ChannelBuffers.new.push (http://localhost:60687/dart_sdk.js:133209:19)
at _engine.EnginePlatformDispatcher.__.invokeOnPlatformMessage (http://localhost:60687/dart_sdk.js:171990:27)
at _engine.TextEditingChannel.new.performAction (http://localhost:60687/dart_sdk.js:186458:49)
at http://localhost:60687/dart_sdk.js:186537:24
at _engine.GloballyPositionedTextEditingStrategy.new.maybeSendAction (http://localhost:60687/dart_sdk.js:178127:40)
at Object._checkAndCall (http://localhost:60687/dart_sdk.js:5279:16)
at Object.dcall (http://localhost:60687/dart_sdk.js:5284:17)
at HTMLInputElement.<anonymous> (http://localhost:60687/dart_sdk.js:109003:100)
I'm doing the most basic initialization:
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
which is generated using flutterfire, and on index.html:
<script type="module" src="https://www.gstatic.com/firebasejs/9.6.10/firebase-auth.js"></script>
<script type="module" src="https://www.gstatic.com/firebasejs/9.6.10/firebase-firestore.js"></script>
<script type="module" src="https://www.gstatic.com/firebasejs/9.6.10/firebase-functions.js"></script>
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.6.10/firebase-app.js";
import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.6.10/firebase-analytics.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "secret",
authDomain: "secret",
projectId: "secret",
storageBucket: "secret",
messagingSenderId: "secret",
appId: "secret",
measurementId: "secret"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
}
I tried to change the versions to newer ones(even though I'm using older ones deliberately) and a lot of different configuration, and nothing worked: js example
as you can see in the loaded js module, the authExtern is unidentified.
git issues addressing the subject:
https://github.com/firebase/flutterfire/issues/9123
https://github.com/firebase/flutterfire/issues/9124
if someone can think on how to bypass this error, it would be very helpful.