-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
a: buildBuilding flutter applications with the toolBuilding flutter applications with the toola: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appdependency: dartDart team may need to help usDart team may need to help use: wasmIssues related to the wasm build of Flutter Web.Issues related to the wasm build of Flutter Web.platform-webWeb applications specificallyWeb applications specificallyr: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issueteam-webOwned by Web platform teamOwned by Web platform team
Description
Steps to reproduce
- I don't know if relevant or not - I have the
flutter_svgdependency added for my web app. - Ran
flutter clean; flutter build web --wasm --releasein the terminal.
Expected results
The Flutter Web App should compile properly with WebAssembly. At least it was working fine with Flutter Version 3.22.1
Actual results
Getting the following error:
Target dart2wasm failed: ProcessException: Process exited abnormally with exit code 64:
*NOTE*: Compilation to WasmGC is experimental.
The support may change, or be removed, with no advance notice.
../../../../.pub-cache/hosted/pub.dev/vector_graphics_compiler-1.1.11+1/lib/src/svg/_tessellator_ffi.dart:6:1: Error: 'dart:ffi' can't be imported when
compiling to Wasm.
import 'dart:ffi' as ffi;
Error: Failed to compile application for the Web.Code sample
No code preview. Just the terminal command:
flutter clean; flutter build web --wasm --release
Screenshots or Video
Not required.
Logs
Here are the full error logs.
Target dart2wasm failed: ProcessException: Process exited abnormally with exit code 64:
*NOTE*: Compilation to WasmGC is experimental.
The support may change, or be removed, with no advance notice.
../../../../.pub-cache/hosted/pub.dev/vector_graphics_compiler-1.1.11+1/lib/src/svg/_tessellator_ffi.dart:6:1: Error: 'dart:ffi' can't be imported when
compiling to Wasm.
import 'dart:ffi' as ffi;
^
../../../../.pub-cache/hosted/pub.dev/vector_graphics_compiler-1.1.11+1/lib/src/svg/_path_ops_ffi.dart:6:1: Error: 'dart:ffi' can't be imported when compiling
to Wasm.
import 'dart:ffi' as ffi;
^
Command: /Users/adityam/Documents/Dev/flutter/bin/cache/dart-sdk/bin/dart compile wasm --packages=.dart_tool/package_config.json
--extra-compiler-option=--dart-sdk=/Users/adityam/Documents/Dev/flutter/bin/cache/dart-sdk
--extra-compiler-option=--platform=/Users/adityam/Documents/Dev/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_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/edd8546116457bdf1c5bdfb13ecb9463d2bb5ed4/ -DFLUTTER_WEB_AUTO_DETECT=false
-DFLUTTER_WEB_USE_SKIA=false -DFLUTTER_WEB_USE_SKWASM=true --extra-compiler-option=--depfile=/Users/adityam/Documents/Mobile
Apps/Memorio/site/.dart_tool/flutter_build/5389598c2a36d064db55a8edf57e320f/dart2wasm.d -O4 --no-name-section -o /Users/adityam/Documents/Mobile
Apps/Memorio/site/.dart_tool/flutter_build/5389598c2a36d064db55a8edf57e320f/main.dart.wasm /Users/adityam/Documents/Mobile
Apps/Memorio/site/.dart_tool/flutter_build/5389598c2a36d064db55a8edf57e320f/main.dart
#0 RunResult.throwException (package:flutter_tools/src/base/process.dart:125:5)
#1 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:321:19)
<asynchronous suspension>
#2 Dart2WasmTarget.build (package:flutter_tools/src/build_system/targets/web.dart:329:5)
<asynchronous suspension>
#3 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:875:9)
<asynchronous suspension>
#4 Future.wait.<anonymous closure> (dart:async/future.dart:524:21)
<asynchronous suspension>
#5 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)
<asynchronous suspension>
#6 Future.wait.<anonymous closure> (dart:async/future.dart:524:21)
<asynchronous suspension>
#7 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)
<asynchronous suspension>
#8 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:642:16)
<asynchronous suspension>
#9 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:92:34)
<asynchronous suspension>
#10 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:230:5)
<asynchronous suspension>
#11 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1394:27)
<asynchronous suspension>
#12 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#13 CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#14 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:372:9)
<asynchronous suspension>
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#16 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:308:5)
<asynchronous suspension>
#17 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
<asynchronous suspension>
#18 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#19 main (package:flutter_tools/executable.dart:93:3)
<asynchronous suspension>
Compiling lib/main.dart for the Web... 24.7s
Error: Failed to compile application for the Web.Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
• Flutter version 3.22.2 on channel stable at /Users/adityam/Documents/Dev/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 761747bfc5 (4 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 (Android SDK version 34.0.0)
• Android SDK at /Users/adityam/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15F31d
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• CHROME_EXECUTABLE = /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
[✓] Android Studio (version 2023.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
[✓] VS Code (version 1.90.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.90.0
[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.4.1 23E224 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.4.1 23E224 darwin-arm64
• Chrome (web) • chrome • web-javascript • Brave Browser 125.1.66.118
! Error: Browsing on the local area network for Aditya Majethia’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the
same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• All expected network resources are available.
• No issues found!GiacomoPignoni and psengelke
Metadata
Metadata
Assignees
Labels
a: buildBuilding flutter applications with the toolBuilding flutter applications with the toola: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appdependency: dartDart team may need to help usDart team may need to help use: wasmIssues related to the wasm build of Flutter Web.Issues related to the wasm build of Flutter Web.platform-webWeb applications specificallyWeb applications specificallyr: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issueteam-webOwned by Web platform teamOwned by Web platform team