flutter-quill icon indicating copy to clipboard operation
flutter-quill copied to clipboard

[Bug in Web] Rejecting promise with error

Open Bankzhy opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

Flutter Quill version

9.3.19

Steps to reproduce

  1. Add the following to pubsec.yaml flutter_quill: 9.3.19 flutter_quill_extensions: 9.3.19
  2. Run the main.dart in Web platform

Expected results

The app build success.

Actual results

I am using the flutter_quill and flutter_quill_extensions in our project. It can't be biuld in Web platform. The error:[Rejecting promise with error: TypeError: Cannot set properties of undefined (setting 'nativeCommunication')]

The web page is totally white and show nothing.

We have both tested in Flutter 3.19.5 and 3.22.1.

Code sample

Code sample
  flutter_quill: 9.3.19
  flutter_quill_extensions: 9.3.19

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Bankzhy avatar May 23 '24 03:05 Bankzhy

I too get this error - Rejecting promise with error: TypeError: Cannot set properties of undefined (setting 'nativeCommunication') I am using flutter_quill 9.3.18 in web. Any help is much appreciated.

Attached is the error screen shot: flutter_quill_error2 flutter_quill_error1

AnithaB05 avatar May 23 '24 08:05 AnithaB05

I have found the solution, may be you can try. just add the following code to the [your project path]\web\index.html

remenber to add it to the top of all

Bankzhy avatar Jun 01 '24 10:06 Bankzhy

Solution founded

Bankzhy avatar Jun 01 '24 10:06 Bankzhy

Hi

Do you know if this bug has been fixed in the latest versions of flutter_quill? It would be helpful to know if adding this script is still necessary or if the updates have resolved the issue.

Thank you.

MarpinLL avatar Sep 25 '24 10:09 MarpinLL

It's a requirement of flutter_inappwebview which included by youtube_player_flutter

Which is needed by flutter_quill_extensions and documented in Platform Specific Configurations

That's why I suggested to discount the support of YouTube video support in #2276. Instead should be possible to implement in the user project without changes directly in this repo.

Loading YouTube videos directly by download URLs without using their iframe is against their terms of service (see #1916), loading iframe requires webview, and webview is not natively supported on Flutter and require platform plugin, having webview in the editor as an embed widget caused many issues and bugs even when not interacting with YouTube Video.

To configure flutter_inappwebview for web, see their Installation section

EchoEllet avatar Sep 25 '24 11:09 EchoEllet

Thank you very much for your response.

MarpinLL avatar Sep 25 '24 11:09 MarpinLL

You're welcome, I'm looking for your feedback about whether you prefer to not have YouTube support built-in as part of flutter_quill_extensions at the price of flexibility and avoid many issues for both the user and developer. See #2284

EchoEllet avatar Sep 25 '24 11:09 EchoEllet

For anyone facing this issue, refer to flutter_inappwebview installation section for web instructions.

I did reopen this issue as it should not be a requirement of flutter_quill_extensions and should only require platform-specific configuration when needed.

We're requiring users for additional configuration for the web when we're not using flutter_inappwebview for web support. Missing the configuration setup doesn't give a clear error message.

EchoEllet avatar Sep 25 '24 12:09 EchoEllet