Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jaredsburrows opened this issue Aug 20, 2024 · 1 comment

Comments

@jaredsburrows
Copy link

jaredsburrows commented Aug 20, 2024

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
@jaredsburrows
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant