-1

When I start my project whose codes I shared, the chrome emulator does not work and I get the following error ;

In main.dart;

import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

In generated_plugin_registrant.dart ;

import 'package:cloud_firestore_web/cloud_firestore_web.dart';
import 'package:firebase_core_web/firebase_core_web.dart';

import 'package:flutter_web_plugins/flutter_web_plugins.dart';

// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
  FirebaseFirestoreWeb.registerWith(registrar);
  FirebaseCoreWeb.registerWith(registrar);
  registrar.registerMessageHandler();
}

Debug Console Error ;

ChromeProxyService: Failed to evaluate expression 'completer.complete': InternalError: No frame with index 14. ChromeProxyService: Failed to evaluate expression 'FirebaseAppPlatform': InternalError: No frame with index 14. ChromeProxyService: Failed to evaluate expression 'context.callMethod': InternalError: No frame with index 14. ChromeProxyService: Failed to evaluate expression '_UnaryFunction': InternalError: No frame with index 112. ChromeProxyService: Failed to evaluate expression 'return': InternalError: No frame with index 112. ChromeProxyService: Failed to evaluate expression ''dart:async': InternalError: No frame with index 112. ChromeProxyService: Failed to evaluate expression ''package': InternalError: No frame with index 112. ChromeProxyService: Failed to evaluate expression '_UnaryFunction': InternalError: No frame with index 112. ChromeProxyService: Failed to evaluate expression 'Function': InternalError: No frame with index 112. ChromeProxyService: Failed to evaluate expression 'registerPlugins': InternalError: No frame with index 112. ChromeProxyService: Failed to evaluate expression '_UnaryFunction': InternalError: No frame with index 112.

enter image description here

enter image description here

enter image description here

How can I solve this problem ?

herik06
  • 158
  • 3
  • 11

1 Answers1

-1

The error message points it out very clearly. You need to configure firebase options in order to use it with flutter web.

Follow the steps here: https://firebase.flutter.dev/docs/manual-installation/web/

or check out this answer: https://stackoverflow.com/a/70234018/14749899

Heck Codes
  • 141
  • 1
  • 7