You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[BUG][iOS] Calling replaceText() on iOS throws Invalid argument(s): Result of JavaScript execution returned a null value. Use runJavascript when expecting a null return value.
#216
Open
Kuroketsu opened this issue
Dec 17, 2024
· 1 comment
Describe the bug
Calling replaceText() on iOS throws Unhandled Exception: Invalid argument(s): Result of JavaScript execution returned a null value. Use runJavascript when expecting a null return value.
Unhandled Exception: Invalid argument(s): Result of JavaScript execution returned a `null` value. Use `runJavascript` when expecting a null return value.
#0 WebKitWebViewController.runJavaScriptReturningResult (package:webview_flutter_wkwebview/src/webkit_webview_controller.dart:481:7)
<asynchronous suspension>
#1 WebViewXController.callJsMethod (package:quill_html_editor/src/widgets/webviewx/src/controller/impl/mobile.dart:124:20)
<asynchronous suspension>
#2 QuillHtmlEditorState._replaceText (package:quill_html_editor/src/quill_editor_wrapper.dart:529:12)
<asynchronous suspension>
#3 QuillEditorController.replaceText (package:quill_html_editor/src/quill_editor_wrapper.dart:1416:12)
<asynchronous suspension>
Expected behavior
Should not throw an exception and replaceText() should work properly.
Smartphone (please complete the following information):
Device: iPhone 16 Plus
OS: iOS 18.0
Package version used:
quill_html_editor: ^2.2.8
Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0.1 24A348 darwin-arm64 (Rosetta), locale en-PH)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.80.1)
[✓] Connected device (5 available)
[✓] Network resources
Describe the bug
Calling replaceText() on iOS throws Unhandled Exception: Invalid argument(s): Result of JavaScript execution returned a
null
value. UserunJavascript
when expecting a null return value.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should not throw an exception and replaceText() should work properly.
Smartphone (please complete the following information):
Package version used:
Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0.1 24A348 darwin-arm64 (Rosetta), locale en-PH)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.80.1)
[✓] Connected device (5 available)
[✓] Network resources
Additional context
I think this issue is related to the callJsMethod of the webviewx_plus package as it uses runJavascriptReturningResult instead of the regular runJavaScript.
I found it on the stackoverflow:
https://stackoverflow.com/questions/76048861/flutter-runjavascriptreturningresult-returns
The text was updated successfully, but these errors were encountered: