universal_html
universal_html copied to clipboard
WASM support: Target dart2wasm failed: ProcessException: Process exited abnormally with exit code 64
Repro:
flutter build web --wasm
Error:
Target dart2wasm failed: ProcessException: Process exited abnormally with exit code 64:
../../.pub-cache/hosted/pub.dev/universal_html-2.2.4/lib/src/_sdk/js.dart:32:1: Error: JS interop library 'dart:js' can't be imported when compiling to Wasm.
Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead.
export 'dart:js';
^
Command: /opt/homebrew/Caskroom/flutter/3.24.0/flutter/bin/cache/dart-sdk/bin/dart compile wasm --packages=.dart_tool/package_config.json
--extra-compiler-option=--platform=/opt/homebrew/Caskroom/flutter/3.24.0/flutter/bin/cache/flutter_web_sdk/kernel/dart2wasm_platform.dill
--extra-compiler-option=--delete-tostring-package-uri=dart:ui --extra-compiler-option=--delete-tostring-package-uri=package:flutter
--extra-compiler-option=--import-shared-memory --extra-compiler-option=--shared-memory-max-pages=32768 -Ddart.vm.product=true -DFLUTTER_WEB_AUTO_DETECT=false
-DFLUTTER_WEB_USE_SKIA=false -DFLUTTER_WEB_USE_SKWASM=true
-DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/b8800d88be4866db1b15f8b954ab2573bba9960f/
--extra-compiler-option=--depfile=/Users/<>/repo/<>/.dart_tool/flutter_build/a9cc494279a9de546c04f05a4f4b7194/dart2wasm.d -O4 --strip-wasm -o
/Users/<>/repo/<>/.dart_tool/flutter_build/a9cc494279a9de546c04f05a4f4b7194/main.dart.wasm
/Users/<>/repo/<>/.dart_tool/flutter_build/a9cc494279a9de546c04f05a4f4b7194/main.dart
Based on https://docs.flutter.dev/platform-integration/web/wasm:
The Flutter and Dart teams are excited to add WebAssembly as a compilation target when building applications for the web.
Note Support for Wasm is now stable! WebAssembly support for Flutter web is available on the Flutter stable channel. Dart's next-gen web interop is now stable! Migrate your packages to package:web and dart:js_interop to make them compatible with Wasm. Read the Requires JS-interop section to learn more.
Any update on this? roadmap? we're now in version 3.29.1.