-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
[REQUIRED] Environment info
firebase-tools: 12.4.6
Platform: Windows
[REQUIRED] Steps to reproduce
- Create a Flutter project that supports web and initialize it with Firebase & firebase hosting
- The app should contain dynamic icons, so that when normally running
flutter build web, you'd have to add the--no-tree-shake-iconsparameter for it to work - Run
firebase deploy
[REQUIRED] Expected behavior
It should deploy the app to firebase and recognize, that it has to add this flag OR an option to add custom flags for the build from the firebase deploy command, e.g. firebase deploy --custom "--no-tree-shake-icons". The second option would fix the actual behavior for other cases.
[REQUIRED] Actual behavior
Getting an error that this application cannot tree shake icon.
Logs:
This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:
<List of file paths>
Target web_release_bundle failed: Exception: Avoid non-constant invocations of IconData or try to build again with --no-tree-shake-icons.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 IconTreeShaker._findConstants (package:flutter_tools/src/build_system/targets/icon_tree_shaker.dart:307:7)
<asynchronous suspension>
#2 IconTreeShaker._getIconData (package:flutter_tools/src/build_system/targets/icon_tree_shaker.dart:108:45)
<asynchronous suspension>
#3 IconTreeShaker.subsetFont (package:flutter_tools/src/build_system/targets/icon_tree_shaker.dart:172:5)
<asynchronous suspension>
#4 copyAssets.<anonymous closure> (package:flutter_tools/src/build_system/targets/assets.dart:127:25)
<asynchronous suspension>
#5 Future.wait.<anonymous closure> (dart:async/future.dart:525:21)
<asynchronous suspension>
#6 copyAssets (package:flutter_tools/src/build_system/targets/assets.dart:105:3)
<asynchronous suspension>
#7 WebReleaseBundle.build (package:flutter_tools/src/build_system/targets/web.dart:385:29)
<asynchronous suspension>
#8 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:847:9)
<asynchronous suspension>
#9 Future.wait.<anonymous closure> (dart:async/future.dart:525:21)
<asynchronous suspension>
#10 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:785:32)
<asynchronous suspension>
#11 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:614:16)
<asynchronous suspension>
#12 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:81:34)
<asynchronous suspension>
#13 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:191:5)
<asynchronous suspension>
#14 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1336:27)
<asynchronous suspension>
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#16 CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#17 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:296:9)
<asynchronous suspension>
#18 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#19 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:244:5)
<asynchronous suspension>
#20 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:91:9)
<asynchronous suspension>
#21 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#22 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
Compiling lib\main.dart for the Web... 2.700ms
Exception: Failed to compile application for the Web.
Error: Unable to build your Flutter app
chris-wickens, zawawawa, GabrielMartinsCarossi, 2lineofcode, janek515 and 6 more