Repository navigation
Description
I am having a HtmlElementView which will have Html content to render it, so when i open it first time its works fine as expected when i go back and open again its showing error.Here i have attached the reproducing example repo https://github.com/ThalapathySiva/flutter_html_reproducing_repo which will have two buttons on home page first click any one of those it will open the html render screen and it will work first time just go back and click the button again it will throw error without rendering and if you go back and refresh the whole window and tapped the button again it works this is the scenario by the way the contentwindow is getting null thats the issue.How can we handle this case. Thank you
Error :
TypeError: Cannot read property 'Symbol(dartx.postMessage)' of null
at http://localhost:55601/dart_sdk.js:33443:33
at internalCallback (http://localhost:55601/dart_sdk.js:25104:11)
Activity
pedromassangocode commentedon Mar 16, 2021
I can reproduce this on latest stable channel.
logs
flutter doctor -v
[✓] Flutter (Channel stable, 2.0.2, on macOS 11.2.2 20D80 darwin-x64, locale en-AO) • Flutter version 2.0.2 at /Users/pedromassango/Code/flutter_stable • Framework revision 8962f6dc68 (4 days ago), 2021-03-11 13:22:20 -0800 • Engine revision 5d8bf811b3 • Dart version 2.12.1 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/pedromassango/Library/Android/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/pedromassango/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [!] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.4, Build version 12D4e ! CocoaPods 1.9.3 out of date (1.10.0 is recommended). CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • 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 1.8.0_242-release-1644-b3-6915495) [✓] IntelliJ IDEA Community Edition (version 2020.3.2) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 54.0.3 • Dart plugin version 203.7759 [✓] VS Code (version 1.54.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.16.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 11.2.2 20D80 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.82 ! Doctor found issues in 1 category.sivaram16 commentedon May 2, 2021
Any update on this ?
ditman commentedon May 3, 2021
This is next in my queue after #80524
sivaram16 commentedon May 4, 2021
Thanks for your reply @ditman Cool
vineeshvk commentedon Jul 22, 2021
+1 Any update on this?
ditman commentedon Jul 28, 2021
Currently working on this, I'll update this ticket tomorrow with more info!
main.dart
assets/view_editor.html (iframe contents)
ditman commentedon Jul 29, 2021
The non-minified error is not much more helpful:
Diving deeper.
1 remaining item
ditman commentedon Jul 29, 2021
I'll keep this issue open, so I can bring this up with the team some time next week.
I think we should re-evaluate that "silent failure" of the
registerViewFactorymethod. IMO the API would be more usable if it allowed overriding the factory every time you call registerFactory, or we failed with a more explicit assertion error.(In any case, this'd be a breaking change on the current API and would need to be released carefully 😄)
sivaram16 commentedon Aug 11, 2021
@ditman Thanks for the possible solution, I have tried it works fine but the only problem that occurs is if I resize the window the view is not displaying it got disappeared, any solution for this?
And thanks for your valuable time.
ditman commentedon Aug 11, 2021
@ThalapathySiva what flutter channel are you using? I think the issue you're describing should be resolved in
master.sivaram16 commentedon Aug 12, 2021
@ditman I haven't checked the master channel yet, I am using the latest stable channel.
ditman commentedon Aug 12, 2021
@ThalapathySiva the fixes haven't been published to Stable definitely, but they might be available in
beta. Please try a newer channel (or wait for the next stable release!)sivaram16 commentedon Aug 13, 2021
@ditman Sure man thank you.