dint-dev / universal_html

Cross-platform 'dart:html'.
https://pub.dev/packages/universal_html
Apache License 2.0
201 stars 60 forks source link

WASM support: Target dart2wasm failed: ProcessException: Process exited abnormally with exit code 64 #102

Open jaredsburrows opened 3 weeks ago

jaredsburrows commented 3 weeks ago

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