-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toolc: crashStack traces logged to the consoleStack traces logged to the consoledependency: dartDart team may need to help usDart team may need to help usdependency:dart-triagedTriaged by Dart teamTriaged by Dart teame: wasmIssues related to the wasm build of Flutter Web.Issues related to the wasm build of Flutter Web.found in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30Found to occur in 3.30has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform teamTriaged by Web platform team
Description
Steps to reproduce
- Create a project with
flutter create --platforms=web flutter_stub - Compile it with
flutter build web --wasm --dart-define FOO="a, b"
Expected results
The project compiles successfully.
Actual results
The compilation fails (see logs section for output).
Code sample
Code sample
Not applicable, as the problem occurs on a freshly created project.Screenshots or Video
No response
Logs
Compilation error message
Target dart2wasm failed: ProcessException: Process exited abnormally with exit code 64:
#0 processEnvironment.<anonymous closure> (package:dart2wasm/dart2wasm.dart:134)
#1 MappedIterable.elementAt (dart:_internal/iterable.dart:402)
#2 ListIterator.moveNext (dart:_internal/iterable.dart:371)
#3 MapBase.addEntries (dart:collection/maps.dart:89)
#4 new Map.fromEntries (dart:core/map.dart:216)
#5 processEnvironment (package:dart2wasm/dart2wasm.dart:131)
#6 options.<anonymous closure> (package:dart2wasm/dart2wasm.dart:70)
#7 Option.applyToOptions (package:dart2wasm/option.dart:19)
#8 parseArguments (package:dart2wasm/dart2wasm.dart:169)
#9 main (package:dart2wasm/dart2wasm.dart:186)
#10 main (file:///b/s/w/ir/x/w/sdk/pkg/dart2wasm/bin/dart2wasm.dart:10)
#11 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:313)
#12 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:194)
Argument Error: Invalid argument(s): Bad define string: b
Usage: dart2wasm [<options>] <infile.dart> <outfile.wasm>
Options:
-h, --help
--[no-]import-shared-memory
--[no-]inlining (defaults to on)
--[no-]minify
--[no-]polymorphic-specialization
--[no-]print-kernel
--[no-]print-wasm
--[no-]js-compatibility
--[no-]enable-asserts
--[no-]omit-explicit-checks
--[no-]omit-implicit-checks
--[no-]omit-bounds-checks
--[no-]verbose
--[no-]verify-type-checks
--[no-]enable-experimental-wasm-interop
--inlining-limit (defaults to "0")
--shared-memory-max-pages
--packages
--libraries-spec
--platform
--watch
-D, --define
--enable-experiment
--multi-root-scheme
--multi-root
--delete-tostring-package-uri
--depfile
--js-runtime-output
--dump-kernel-after-cfe
--dump-kernel-before-tfa
--dump-kernel-after-tfa
--[no-]enable-experimental-ffi
--[no-]no-source-maps
--[no-]enable-deferred-loading
--[no-]enable-multi-module-stress-test-mode
--dynamic-module-main
--dynamic-module-interface
--dynamic-module-metadata
Command: /home/christian/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/dart compile wasm --packages=/home/christian/workbench/flutter_stub/.dart_tool/package_config.json
--extra-compiler-option=--platform=/home/christian/snap/flutter/common/flutter/bin/cache/flutter_web_sdk/kernel/dart2wasm_platform.dill -Ddart.vm.profile=false -Ddart.vm.product=true
--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 -DFOO=a, b -DFLUTTER_WEB_USE_SKIA=false -DFLUTTER_WEB_USE_SKWASM=true
-DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/f73bfc4522dd0bc87bbcdb4bb3088082755c5e87/
--extra-compiler-option=--depfile=/home/christian/workbench/flutter_stub/.dart_tool/flutter_build/4fe51ac78efe0ee6dfee041c5ea3b350/dart2wasm.d -O4 --strip-wasm --no-source-maps -o
/home/christian/workbench/flutter_stub/.dart_tool/flutter_build/4fe51ac78efe0ee6dfee041c5ea3b350/main.dart.wasm
/home/christian/workbench/flutter_stub/.dart_tool/flutter_build/4fe51ac78efe0ee6dfee041c5ea3b350/main.dart
#0 RunResult.throwException (package:flutter_tools/src/base/process.dart:118:5)
#1 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:344:19)
<asynchronous suspension>
#2 Dart2WasmTarget.build (package:flutter_tools/src/build_system/targets/web.dart:346:5)
<asynchronous suspension>
#3 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:876:9)
<asynchronous suspension>
#4 Future.wait.<anonymous closure> (dart:async/future.dart:528:21)
<asynchronous suspension>
#5 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:814:32)
<asynchronous suspension>
#6 Future.wait.<anonymous closure> (dart:async/future.dart:528:21)
<asynchronous suspension>
#7 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:814:32)
<asynchronous suspension>
#8 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:637:16)
<asynchronous suspension>
#9 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:93:34)
<asynchronous suspension>
#10 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:253:5)
<asynchronous suspension>
#11 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1558:27)
<asynchronous suspension>
#12 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154: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:496:9)
<asynchronous suspension>
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:19)
<asynchronous suspension>
#16 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:431:5)
<asynchronous suspension>
#17 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:98:11)
<asynchronous suspension>
#18 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:19)
<asynchronous suspension>
#19 main (package:flutter_tools/executable.dart:99:3)
<asynchronous suspension>
Compiling lib/main.dart for the Web... 15,7s
Error: Failed to compile application for the Web.Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.29.0, on Arch Linux 6.13.5-arch1-1, locale de_DE.UTF-8) [234ms]
• Flutter version 3.29.0 on channel stable at /home/christian/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 35c388afb5 (vor 4 Wochen), 2025-02-10 12:48:41 -0800
• Engine revision f73bfc4522
• Dart version 3.7.0
• DevTools version 2.42.2
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [2,0s]
• Android SDK at /home/christian/Android/Sdk
• Platform android-35, build-tools 35.0.1
• Java binary at: /usr/bin/java
This JDK was found in the system PATH.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 17.0.14+7)
• All Android licenses accepted.
[✓] Chrome - develop for the web [121ms]
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop [341ms]
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1
[!] Android Studio (not installed) [119ms]
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
[✓] IntelliJ IDEA Community Edition (version 2024.3) [119ms]
• IntelliJ at /var/lib/snapd/snap/intellij-idea-community/572
• Flutter plugin version 83.0.4
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] Connected device (2 available) [197ms]
• Linux (desktop) • linux • linux-x64 • Arch Linux 6.13.5-arch1-1
• Chrome (web) • chrome • web-javascript • Chromium 134.0.6998.35 Arch Linux
[✓] Network resources [644ms]
• All expected network resources are available.
! Doctor found issues in 1 category.davidmigloz
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toolc: crashStack traces logged to the consoleStack traces logged to the consoledependency: dartDart team may need to help usDart team may need to help usdependency:dart-triagedTriaged by Dart teamTriaged by Dart teame: wasmIssues related to the wasm build of Flutter Web.Issues related to the wasm build of Flutter Web.found in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30Found to occur in 3.30has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform teamTriaged by Web platform team