skip to Main Content

When running Firebase on android, there is no problem, but when debugging on the web (chrome or edge), it doesn’t work… in the Debug Console a DART_SDK.JS problem notification appears, like this:

"Locations: No module for http://localhost:53xxx/dart_sdk.js"

This notification only appears when running at Firebase.initializeApp();

My Code:

void main() async {
      WidgetsFlutterBinding.ensureInitialized();
      await Firebase.initializeApp();
    
      runApp(
        MaterialApp(
          title: "Firebase", 
          home: MyApp()
        )
      );
    }

3

Answers


  1. The problem is that you need to configure some extra things for web to work in your initializeApp method

     Platform.isAndroid? await Firebase.initializeApp():await Firebase.initializeApp(
            // Replace with actual values
            options: const FirebaseOptions(
              apiKey: "your api key from firebase console here ",
              appId: "your apid from firebase console here",
              messagingSenderId: "XXX",
              projectId: "your project id",
            ),
          );
    
    Login or Signup to reply.
  2. Anyone initializing with web information and still getting this error on
    Flutter 3.3.1 • channel stable
    Framework • revision 4f9d92f (20 hours ago) • 2022-09-06 17:54:53 -0700
    Engine • revision 3efdf03e73
    Tools • Dart 2.18.0 • DevTools 2.15.0
    ->Try changing channel to flutter channel stable
    for that run these commands in flutter terminal

    flutter channel master
    flutter upgrade
    
    Login or Signup to reply.
  3. Try to run the application without debugging.
    Flutter new release 3.3.4 maybe is not stable yet.
    Reference link for the error : Locations: No module for http://localhost:/dart_sdk.js

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search