Open uldall opened 2 weeks ago
Note that I used this PR to get WebView to work on web: https://github.com/flutter/packages/pull/6792 as well as this branch to add the credentialless attribute: https://github.com/ThomasAunvik/flutter-packages/tree/wasmcredentialless
Further testing shows that the error also happens on other simple HTML websites, so maybe it isn't related to some Godot specific functionality (like WebGL). I was however able to load pages at some point, so I am a bit confused about what causes it to work. It is however super easy to reproduce the error as seen in the example code.
@uldall have you tried building & running with the -O1
optimization flag (the default -O4
is very aggressive and can sometimes make errors appear much later and therefore in seemingly unrelated places)?
@mkustermann I tried this now: $ flutter build web --wasm --no-strip-wasm -O1
(And without the --no-strip-wasm). Unfortunately it didn't make a difference.
Thanks for the report. I was able to replicate the reported behavior using the details provided.
@mkustermann I tried this now: $ flutter build web --wasm --no-strip-wasm -O1 (And without the --no-strip-wasm). Unfortunately it didn't make a difference.
If using -O1
doesn't change the error and the error happens in skwasm.wasm
then maybe the issue is in flutter engine /cc @eyebrowsoffire
I don't think this is limited to Godot game. I have my website migrated to wasm and it has carousel. Swiping on carousel for a longer time also created this issue:
main.dart.js:3304 Uncaught RuntimeError: memory access out of bounds at canvaskit.wasm:0x3abfc at canvaskit.wasm:0x29150 at Tb.save (canvaskit.js:115:52) at Gv.d6 (main.dart.js:26771:53) at B_.j6 (main.dart.js:26595:3) at KO.jU (main.dart.js:26486:28) at a1L.$0 (main.dart.js:26727:18) at Object.axo (main.dart.js:1160:18) at a1I.aj5 (main.dart.js:26715:3) at main.dart.js:27070:27
Steps to reproduce
WebViewWidget
widget. For example this game.flutter build web --wasm
.Note that a fix for webview_flutter_web is added to be able to use
WebViewWidget
with wasm.Expected results
The game is shown like it is when not using --wasm:![image](https://github.com/flutter/flutter/assets/628383/811c0bec-608e-4201-a340-795ede6298fd)
Actual results
The error is shown and the Godot game is not loaded:![image](https://github.com/flutter/flutter/assets/628383/39b69ea1-d55a-492e-ba42-72ef36946162)
Code sample
Code sample
```dart import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter_web/webview_flutter_web.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title}); final String title; @override StateDownload the full sample here: https://github.com/uldall/wasmtestgodot
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]Logs
Logs
```console skwasm.wasm:0xa0a8 Uncaught RuntimeError: memory access out of bounds at skwasm.wasm:0xa0a8 at skwasm.wasm:0x1e5318 at w._surface_renderPicturesOnWorker (skwasm.js:129:388) at f (skwasm.js:61:400) $free @ skwasm.wasm:0xa0a8 $surface_renderPicturesOnWorker @ skwasm.wasm:0x1e5318 w._surface_renderPicturesOnWorker @ skwasm.js:129 f @ skwasm.js:61 ```Flutter Doctor output
Doctor output
```console $ flutter doctor -v [✓] Flutter (Channel stable, 3.22.2, on Fedora Linux 40 (Workstation Edition) 6.8.11-300.fc40.x86_64, locale en_US.UTF-8) • Flutter version 3.22.2 on channel stable at /home/uldall/git/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 761747bfc5 (7 days ago), 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 ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use `flutter config --android-sdk` to update to that location. [✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [✗] Linux toolchain - develop for Linux desktop ✗ clang++ is required for Linux development. It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/ ✗ CMake is required for Linux development. It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/ ✗ ninja is required for Linux development. It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from https://github.com/ninja-build/ninja/releases • pkg-config version 2.1.0 ✗ GTK 3.0 development libraries are required for Linux development. They are likely available from your distribution (e.g.: apt install libgtk-3-dev) [!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions). [✓] VS Code (version 1.89.1) • VS Code at /var/lib/flatpak/app/com.visualstudio.code/x86_64/stable/active/files/extra/vscode • Flutter extension version 3.90.0 [✓] Connected device (1 available) • Linux (desktop) • linux • linux-x64 • Fedora Linux 40 (Workstation Edition) 6.8.11-300.fc40.x86_64 [✓] Network resources • All expected network resources are available. ! Doctor found issues in 4 categories. ```