Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quill does not work with flutter web ? #2355

Closed
1 task done
BenoistDemeure opened this issue Nov 7, 2024 · 5 comments
Closed
1 task done

quill does not work with flutter web ? #2355

BenoistDemeure opened this issue Nov 7, 2024 · 5 comments
Labels
question Further information is requested

Comments

@BenoistDemeure
Copy link

Is there an existing issue for this?

The question

I created a default flutter web project with Android Studio.
When i add the dependency to flutter_quill, then chrome stuck on the loading flutter loading screen ( the blue linear progress on top of the page loop indefinitely )
when i remove this dependency, the app run correctly

@BenoistDemeure BenoistDemeure added the question Further information is requested label Nov 7, 2024
@EchoEllet
Copy link
Collaborator

Can you share the console log? Open the web app in Google Chrome, right-click, select Inspect then Console tab.

@EchoEllet EchoEllet added the awaiting response Pending additional information or feedback from the issue creator label Nov 7, 2024
@BenoistDemeure
Copy link
Author

BenoistDemeure commented Nov 8, 2024

Since i reopened android studio , i have no more the error.
But a colleague is facing to the same problem on 50% of the launches...
He will give you more explanation

(using flutter 3.24.0)

@AdrienGomes
Copy link

AdrienGomes commented Nov 8, 2024

I'm facing the same issues as explained by @BenoistDemeure.
These issues seem to only appear when starting the project in debug flutter mode.

Reproducible steps :

  • Flutter version : 3.24.0
  • dart sdk : 3.5.0
  • flutter_quill : 10.8.5
  1. From VSCode command : Flutter: New Project
  2. From VSCode command : _Dart: Add dependency _ -> type enter -> select flutter_quill

Personal env :

File _main.dart_ :
import 'package:flutter/material.dart';
import 'package:flutter_quill/flutter_quill.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // TRY THIS: Try running your application with "flutter run". You'll see
        // the application has a purple toolbar. Then, without quitting the app,
        // try changing the seedColor in the colorScheme below to Colors.green
        // and then invoke "hot reload" (save your changes or press the "hot
        // reload" button in a Flutter-supported IDE, or press "r" if you used
        // the command line to start the app).
        //
        // Notice that the counter didn't reset back to zero; the application
        // state is not lost during the reload. To reset the state, use hot
        // restart instead.
        //
        // This works for code too, not just values: Most code changes can be
        // tested with just a hot reload.
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  QuillController _controller = QuillController.basic();
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // TRY THIS: Try changing the color here to a specific color (to
        // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
        // change color while the other colors stay the same.
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          //
          // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
          // action in the IDE, or press "p" in the console), to see the
          // wireframe for each widget.
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            QuillEditor.basic(
              controller: _controller,
            ),
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
File _pubspec.yaml_ :
name: flutter_test_quill
description: "A new Flutter project."
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1

environment:
  sdk: ^3.5.0

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.8
  flutter_quill: ^10.8.5

dev_dependencies:
  flutter_test:
    sdk: flutter

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^4.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/to/resolution-aware-images

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/to/asset-from-package

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/to/font-from-package

During my successive attempts to launch main.dart :

  • Error in chrome console : dom.dart:184 Rejecting promise with error: TypeError: Cannot read properties of undefined (reading 'webPluginRegistrar')

  • Error in chrome console : dart_sdk.js:56 Uncaught TypeError: Cannot read properties of undefined (reading 'Symbol(_privateNames)')

  • Error in chrome console : dom.dart:184 Rejecting promise with error: TypeError: Cannot read properties of undefined (reading 'DeviceInfoPlusWebPlugin')

@CatHood0 CatHood0 removed the awaiting response Pending additional information or feedback from the issue creator label Nov 10, 2024
@EchoEllet
Copy link
Collaborator

EchoEllet commented Nov 11, 2024

  • TypeError: Cannot read properties of undefined (reading 'DeviceInfoPlusWebPlugin')

Newer versions of flutter_quill (including the one you're using) don't depend on device_info_plus or DeviceInfoPlusWebPlugin.

  • Can you confirm if this issue happens on a new empty project with only flutter_quill added?
  • Can you test and run the example web app of the Flutter Quill? Since I'm unable to reproduce any issues.

The flutter pub upgrade is needed to update the transitive dependencies in your project.

@EchoEllet EchoEllet added the awaiting response Pending additional information or feedback from the issue creator label Nov 11, 2024
@AdrienGomes
Copy link

AdrienGomes commented Nov 12, 2024

Running on an empty project

I confirm that the issue still happens on an empty project with only flutter_quill added (same version as previous) when quill_native_bridge_web seems to be in version 0.0.1-dev.4.

  • Running flutter pub upgrade as suggested seems to have solved the problems for some reason as i am unable to reproduce the problems. Only one dependency changes : quill_native_bridge_web going from 0.0.1-dev.4 to 0.0.1-dev.5

image

I've also ran the example

  • From master (38 commits from last pull) - I've last pulled master at 12/11/2024T9:40 utc -> No problems, i cannot reproduce any of the issues
  • From tag v10.8.5 -> The web application does not launch. Chrome log is :
    image

Here is a full video of my manipulation :
https://github.com/user-attachments/assets/4ecb52f9-0fde-4aec-8f67-232dc71cc0e4

@EchoEllet EchoEllet removed the awaiting response Pending additional information or feedback from the issue creator label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants