1

I have been debugging my flutter Web app on an actual android device for some time and it has been going well, its actually a web app, and i found it easier to test it on my phone then build it and deploy it using firebase hosting, the moment i tried debugging it in my chrome browser on my PC i keep getting errors and it won't build, i even tried upgrading the flutter SDK from 3 to 3.3 but still, I'm getting the errors below, i don't understand what's going, i read only about deleting any "import dart.js" or "import HTML" but still doesn't work, any help? I have uploaded my code on a public github because i wasn't sure which part of my code to add here

https://github.com/bookingengine-malawi/sella

/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.7.3/lib/src/firebase_core_web.dart:81:5: Error: 'ScriptElement' isn't a type.
    ScriptElement script = ScriptElement();
    ^^^^^^^^^^^^^
/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.7.3/lib/src/firebase_core_web.dart:81:28: Error: The method 'ScriptElement' isn't defined for the class 'FirebaseCoreWeb'.
- 'FirebaseCoreWeb' is from 'package:firebase_core_web/firebase_core_web.dart' ('/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.7.3/lib/firebase_core_web.dart').
package:firebase_core_web/firebase_core_web.dart:1
Try correcting the name to the name of an existing method, or defining a method named 'ScriptElement'.
    ScriptElement script = ScriptElement();

                           ^^^^^^^^^^^^^
/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.7.3/lib/src/firebase_core_web.dart:90:12: Error: The getter 'document' isn't defined for the class 'FirebaseCoreWeb'.
- 'FirebaseCoreWeb' is from 'package:firebase_core_web/firebase_core_web.dart' ('/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.7.3/lib/firebase_core_web.dart').
package:firebase_core_web/firebase_core_web.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'document'.
    assert(document.head != null);
           ^^^^^^^^
/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.7.3/lib/src/firebase_core_web.dart:91:5: Error: The getter 'document' isn't defined for the class 'FirebaseCoreWeb'.
- 'FirebaseCoreWeb' is from 'package:firebase_core_web/firebase_core_web.dart' ('/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.7.3/lib/firebase_core_web.dart').
package:firebase_core_web/firebase_core_web.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'document'.
    document.head!.append(script);
    ^^^^^^^^
/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-4.6.1/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart:67:7: Error: 'Element' isn't a type.
      Element? el = window.document.getElementById(_kInvisibleElementId);
      ^^^^^^^
/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-4.6.1/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart:67:21: Error: The getter 'window' isn't defined for the class 'RecaptchaVerifierFactoryWeb'.
- 'RecaptchaVerifierFactoryWeb' is from 'package:firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart' ('/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-4.6.1/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart').
package:firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'window'.
      Element? el = window.document.getElementById(_kInvisibleElementId);
                    ^^^^^^
/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-4.6.1/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart:74:7: Error: The getter 'window' isn't defined for the class 'RecaptchaVerifierFactoryWeb'.
- 'RecaptchaVerifierFactoryWeb' is from 'package:firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart' ('/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-4.6.1/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart').
package:firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'window'.

      window.document.documentElement!.children
      ^^^^^^
/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-4.6.1/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart:75:16: Error: The method 'DivElement' isn't defined for the class 'RecaptchaVerifierFactoryWeb'.
- 'RecaptchaVerifierFactoryWeb' is from 'package:firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart' ('/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-4.6.1/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart').
package:firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart:1
Try correcting the name to the name of an existing method, or defining a method named 'DivElement'.
          .add(DivElement()..id = _kInvisibleElementId);
               ^^^^^^^^^^
/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-4.6.1/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart:83:9: Error: The getter 'window' isn't defined for the class 'RecaptchaVerifierFactoryWeb'.
- 'RecaptchaVerifierFactoryWeb' is from 'package:firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart' ('/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-4.6.1/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart').
package:firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'window'.
        window.document.getElementById(container) != null,
        ^^^^^^
/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-4.6.1/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart:131:5: Error: The getter 'window' isn't defined for the class 'RecaptchaVerifierFactoryWeb'.
- 'RecaptchaVerifierFactoryWeb' is from 'package:firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart' ('/C:/flutter_windows_2.2.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-4.6.1/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart').
package:firebase_auth_web/src/firebase_auth_web_recaptcha_verifier_factory.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'window'.
    window.document.getElementById(_kInvisibleElementId)?.remove();
    ^^^^^^
Failed to compile application.
Exited (sigterm)
mac
  • 211
  • 3
  • 8

0 Answers0