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
{{ message }}
Repository navigation
[web] Safari white frame when removing (last?) platform view #84832
I recently built an app on flutter web using the latest master and I am experiencing random white screens or crashes when tapping around, see the link here App
RPReplay_Final1623992205.MP4
Flutter Doctor
[✓] Flutter (Channel master, 2.3.0-17.0.pre.390, on Mac OS X 10.15.7 19H105 darwin-x64, locale
en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.57.0)
[✓] Connected device (2 available)
@peerwaya
Can you provide the crash log it generates ? Is the behavior replicable locally in debug mode or in release mode ?
Can you also provide a complete minimal reproducible code sample that we can use that shows the crashes ?
I tried the gallery app and ran it in release mode using latest master and opened it in safari browser. Clicked through the app features but don't seem to get any crash / white frames.
I noticed this happens with a Link Widget or something with a Platform view underneath on web especially iOS Safari. It's not so noticeable on chrome. It is fine on stable channel but It seems to have started after the slots refactor done by @ditman. @ditman what do you think?
Onyemaechis-MacBook-Pro:mini_test evenmatrix$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 2.3.0-17.0.pre.421, on Mac OS X 10.15.7 19H105 darwin-x64, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.57.1)
[✓] Connected device (3 available)
If you visit that fiddle in Safari, the end result will be a "red" screen, but if you use Chrome, the end result will be "green".
I hope the JS code is easy to understand; I'll create a bug for Safari ASAP, but first I'll try to implement a mitigation strategy into flutter. We have two options:
Delete the "slotted" content before the slot itself. This could be a permanent fix, but I need to dive deeper in the ordering of the flutter events regarding web views.
Never delete the root container of the "slotted" content (this will seem like a "DOM node leak" from the outside, but this would be a temporary fix until Safari gets fixed).
We have a workaround for this that doesn't leave DOM nodes hanging. Deleting the slotted content before the slot was not practical, due to how flutter rendering pipeline works.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
darshankawar commentedon Jun 18, 2021
@peerwaya
Can you provide the crash log it generates ? Is the behavior replicable locally in debug mode or in release mode ?
Can you also provide a complete minimal reproducible code sample that we can use that shows the crashes ?
peerwaya commentedon Jun 18, 2021
This is currently running in release mode, no crash log. happens randomly.
peerwaya commentedon Jun 18, 2021
You can try the latest gallery app in release mode on the latest master running on ios safari
darshankawar commentedon Jun 18, 2021
I tried the gallery app and ran it in release mode using latest master and opened it in safari browser. Clicked through the app features but don't seem to get any crash / white frames.
peerwaya commentedon Jun 18, 2021
Hi @darshankawar , please run it on iOS safari not desktop safari, I am working on a minimum sample
peerwaya commentedon Jun 23, 2021
Here is a minimum sample
repo: https://github.com/GotokHQ/mini_test
demo: https://dev-web-gotok.firebaseapp.com/#/
peerwaya commentedon Jun 23, 2021
I noticed this happens with a Link Widget or something with a Platform view underneath on web especially iOS Safari. It's not so noticeable on chrome. It is fine on stable channel but It seems to have started after the slots refactor done by @ditman. @ditman what do you think?
https://dev-web-gotok.firebaseapp.com/#/
RPReplay_Final1624431039.MP4
peerwaya commentedon Jun 23, 2021
To see the effect, try switching the tabs
15 remaining items
peerwaya commentedon Jun 30, 2021
is it possible to fallback to the implementation without slots for safari as a temporary workaround?
ditman commentedon Jun 30, 2021
@peerwaya use flutter channel
masterfor that, until we land the workaround.ditman commentedon Jun 30, 2021
I've reproduced the white page in development mode, locally, and with canvaskit rendering.
This is good news, because it probably means that this is a ShadowDOM Safari bug. I'm diving deeper.
ditman commentedon Jul 1, 2021
OK, I think I've minimally reproduced the issue (without flutter web). Here's the link:
https://jsfiddle.net/ditman/rmwqjLah
If you visit that fiddle in Safari, the end result will be a "red" screen, but if you use Chrome, the end result will be "green".
I hope the JS code is easy to understand; I'll create a bug for Safari ASAP, but first I'll try to implement a mitigation strategy into flutter. We have two options:
ditman commentedon Jul 3, 2021
We have a workaround for this that doesn't leave DOM nodes hanging. Deleting the slotted content before the slot was not practical, due to how flutter rendering pipeline works.
ditman commentedon Jul 3, 2021
The PR with a workaround is here:
The underlying issue has been reported to Webkit, here:
[-][web] iOS Safari random crashes/white frame[/-][+][web] Safari white frame when removing (last?) platform view[/+]ditman commentedon Jul 7, 2021
The fix is rolling into flutter/master here:
ditman commentedon Jul 7, 2021
The fix has rolled into flutter master successfully.
github-actions commentedon Jul 30, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.