tneotia / html-editor-enhanced

A Flutter package that provides a WYSIWYG editor backed by flutter_inappwebview and the Summernote library.
https://pub.dev/packages/html_editor_enhanced
MIT License
272 stars 324 forks source link

[bug] Flutter 3.22.2 cause error on web #523

Open hakama99 opened 1 month ago

hakama99 commented 1 month ago
          @tneotia 

I used Flutter 3.19.6 and html_editor_enhanced 2.5.1 without any issues. I upgrade to flutter 3.22.2, my web platform has error with html_editor_enhanced version 2.6.0, web shows with empty. I update to html_editor_enhanced version 2.6.0 has same ques.

aa

Rejecting promise with error: TypeError: Cannot set properties of undefined (setting 'nativeCommunication')

A message on the flutter/lifecycle channel was discarded before it could be handled.
This happens when a plugin sends messages to the framework side before the framework has had an opportunity to register a listener. See the
ChannelBuffers API documentation for details on how to configure the channel to expect more messages, or to expect messages to get
discarded:
  https://api.flutter.dev/flutter/dart-ui/ChannelBuffers-class.html

but it fine on https://github.com/carmigo/html-editor-enhanced.

html_editor_enhanced:
    git: https://github.com/carmigo/html-editor-enhanced

Originally posted by @hakama99 in https://github.com/tneotia/html-editor-enhanced/issues/509#issuecomment-2224957451

[✓] Flutter (Channel stable, 3.22.2, on macOS 14.1.2 23B92 darwin-arm64, locale zh-Hant-TW)
    • Flutter version 3.22.2 on channel stable at /Users/leo/Desktop/git/flutterSDK
    • Upstream repository https://github.com/flutter/flutter
    • Framework revision 761747bfc5 (6 周前), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/leo/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/leo/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode-15.0.1.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.91.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.92.0

[✓] Connected device (6 available)
    • mike (mobile)                       • 00008110-0008552114DB801E            • ios            • iOS 17.5.1 21F90
    • leo的iPhone (mobile)                 • 00008110-001E35CA26BA201E            • ios            • iOS 17.5.1 21F90
    • Palmira (mobile)                    • 00008110-0002786202F0401E            • ios            • iOS 17.5.1 21F90
    • iPhone SE (3rd generation) (mobile) • 67C91645-117E-44F2-9B3F-10AE522ED9FA • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • Mac Designed for iPad (desktop)     • mac-designed-for-ipad                • darwin         • macOS 14.1.2 23B92
      darwin-arm64
    • Chrome (web)                        • chrome                               • web-javascript • Google Chrome
      126.0.6478.127
    ! Error: Browsing on the local area network for Ryne. Ensure the device is unlocked and attached with a cable or
      associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.
ALIKHAN4733 commented 1 month ago

when will we get the html_editor_enhanced: git: https://github.com/carmigo/html-editor-enhanced" URL on pubspec?

hakama99 commented 1 month ago

我們什麼時候才能在 pubspec 上取得 html_editor_enhanced: git: https://github.com/carmigo/html-editor-enhanced " URL?

 html_editor_enhanced:
      git: https://github.com/carmigo/html-editor-enhanced

instead

  html_editor_enhanced: any
sfratini commented 1 week ago

It is actually related to one of the packages that the editor uses. Add this to the web/index.html, head section:

<script
    type="application/javascript"
    src="/assets/packages/flutter_inappwebview_web/assets/web/web_support.js"
    defer
  ></script>

More info here: https://github.com/pichillilorenzo/flutter_inappwebview/issues/1468

And you can see that the example in this repo actually has that section as well.