flutterfire
flutterfire copied to clipboard
🐛 [firebase_auth_web] Cannot read properties of undefined (reading 'auth')
Bug report
Describe the bug I am using flutter fire on my flutter web app and flutterfire_ui plugin for auth. I'm initialising the firebase dependencies in index.html file like this:
But as soon as I hit sign in button I get an exception. Btw I'm using signInWithEmail with flutterfire_ui.
TypeError: Cannot read properties of undefined (reading 'auth')
at Object.getAuthInstance (http://localhost:57052/packages/firebase_auth_web/src/interop/auth.dart.lib.js:1037:70)
at get [_delegate] (http://localhost:57052/packages/firebase_auth_web/firebase_auth_web.dart.lib.js:81:49)
at new firebase_auth_web.FirebaseAuthWeb.new (http://localhost:57052/packages/firebase_auth_web/firebase_auth_web.dart.lib.js:476:9)
at firebase_auth_web.FirebaseAuthWeb..delegateFor (http://localhost:57052/packages/firebase_auth_web/firebase_auth_web.dart.lib.js:86:14)
at FirebaseAuthPlatform.instanceFor (http://localhost:57052/packages/firebase_auth_platform_interface/src/types.dart.lib.js:1665:77)
at get [_delegate] (http://localhost:57052/packages/firebase_auth/firebase_auth.dart.lib.js:91:135)
at firebase_auth.FirebaseAuth..signInWithCredential (http://localhost:57052/packages/firebase_auth/firebase_auth.dart.lib.js:272:68)
at signInWithCredential.next (
Flutter doctor
Run flutter doctor and paste the output below:
Click To Expand
[✓] Flutter (Channel stable, 2.10.0, on macOS 11.6 20G165 darwin-x64, locale en-GB)
• Flutter version 2.10.0 at /Users/hinnarutaba/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5f105a6ca7 (6 months ago), 2022-02-01 14:15:42 -0800
• Engine revision 776efd2034
• Dart version 2.16.0
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/hinnarutaba/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
[✓] VS Code (version 1.67.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.40.0
[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.134
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Flutter dependencies
Run flutter pub deps -- --style=compact and paste the output below:
Click To Expand
firebase_auth: 3.4.1
firebase_auth_web: 3.3.19
firebase_core: 1.13.1
flutterfire_ui: 0.4.2+2
@rutaba1 Please upgrade your stable version to latest (3.0.5) and below plugins to their latest versions and try again:
https://pub.dev/packages/flutterfire_ui/changelog#0431 https://pub.dev/packages/firebase_auth/changelog#351 https://pub.dev/packages/firebase_auth_web/changelog#411
@darshankawar Updating to latest dependencies is causing persistence issue that's why I'm trying to stick to the old versions
There's an active PR to fix persistence issue that you subscribe to for further updates.
Hey @rutaba1. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@rutaba1 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.