Skip to content

Flutter Web 3.10, tree shake still causing exception (fail) #126793

@westlinkin

Description

@westlinkin

Is there an existing issue for this?

Steps to reproduce

  1. Upgraded to Flutter 3.10
  2. exec flutter build web --web-renderer canvaskit

Expected results

it should build Flutter Web app.

According to the 3.10 release notes, Flutter Web should support tree shake.

Actual results

compile failed.
Here is the log:

Font asset "icomoon.ttf" was tree-shaken, reducing it from 1128 to 696 bytes (38.3% reduction). Tree-shaking can be disabled by providing the
--no-tree-shake-icons flag when building your app.
Font asset "CupertinoIcons.ttf" was tree-shaken, reducing it from 283452 to 1472 bytes (99.5% reduction). Tree-shaking can be disabled by
providing the --no-tree-shake-icons flag when building your app.
Font asset "AntDesign.ttf" was tree-shaken, reducing it from 70344 to 61444 bytes (12.7% reduction). Tree-shaking can be disabled by providing
the --no-tree-shake-icons flag when building your app.
Font asset "Entypo.ttf" was tree-shaken, reducing it from 66200 to 59840 bytes (9.6% reduction). Tree-shaking can be disabled by providing the
--no-tree-shake-icons flag when building your app.
Font asset "EvilIcons.ttf" was tree-shaken, reducing it from 13456 to 11752 bytes (12.7% reduction). Tree-shaking can be disabled by providing
the --no-tree-shake-icons flag when building your app.
Font asset "FontAwesome.ttf" was tree-shaken, reducing it from 165548 to 156252 bytes (5.6% reduction). Tree-shaking can be disabled by
providing the --no-tree-shake-icons flag when building your app.
Font asset "Feather.ttf" was tree-shaken, reducing it from 56228 to 52096 bytes (7.3% reduction). Tree-shaking can be disabled by providing
the --no-tree-shake-icons flag when building your app.
Font asset "Fontisto.ttf" was tree-shaken, reducing it from 313528 to 311148 bytes (0.8% reduction). Tree-shaking can be disabled by providing
the --no-tree-shake-icons flag when building your app.
Font asset "Foundation.ttf" was tree-shaken, reducing it from 56976 to 53220 bytes (6.6% reduction). Tree-shaking can be disabled by providing
the --no-tree-shake-icons flag when building your app.
Font asset "Ionicons.ttf" was tree-shaken, reducing it from 247192 to 224468 bytes (9.2% reduction). Tree-shaking can be disabled by providing
the --no-tree-shake-icons flag when building your app.
Font asset "MaterialIcons.ttf" was tree-shaken, reducing it from 230384 to 186436 bytes (19.1% reduction). Tree-shaking can be disabled by
providing the --no-tree-shake-icons flag when building your app.
Font asset "Octicons.ttf" was tree-shaken, reducing it from 49404 to 45600 bytes (7.7% reduction). Tree-shaking can be disabled by providing
the --no-tree-shake-icons flag when building your app.
Font asset "SimpleLineIcons.ttf" was tree-shaken, reducing it from 54056 to 51000 bytes (5.7% reduction). Tree-shaking can be disabled by
providing the --no-tree-shake-icons flag when building your app.
Font asset "Zocial.ttf" was tree-shaken, reducing it from 25788 to 23996 bytes (6.9% reduction). Tree-shaking can be disabled by providing the
--no-tree-shake-icons flag when building your app.
Font asset "fa-brands-400.ttf" was tree-shaken, reducing it from 187448 to 169440 bytes (9.6% reduction). Tree-shaking can be disabled by
providing the --no-tree-shake-icons flag when building your app.
Font asset "fa-regular-400.ttf" was tree-shaken, reducing it from 63728 to 48796 bytes (23.4% reduction). Tree-shaking can be disabled by
providing the --no-tree-shake-icons flag when building your app.
Font asset "fa-solid-900.ttf" was tree-shaken, reducing it from 394832 to 357436 bytes (9.5% reduction). Tree-shaking can be disabled by
providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 10784 bytes (99.3% reduction). Tree-shaking can be
disabled by providing the --no-tree-shake-icons flag when building your app.
Codepoint 62694 not found in font, aborting.


Codepoint 62694 not found in font, aborting.


Codepoint 62694 not found in font, aborting.


Codepoint 63116 not found in font, aborting.


Target web_release_bundle failed: IconTreeShakerException: Font subsetting failed with exit code 255.

To disable icon tree shaking, pass --no-tree-shake-icons to the requested flutter build command
#0      IconTreeShaker.subsetFont (package:flutter_tools/src/build_system/targets/icon_tree_shaker.dart:208:7)
<asynchronous suspension>
#1      copyAssets.<anonymous closure> (package:flutter_tools/src/build_system/targets/assets.dart:127:25)
<asynchronous suspension>
#2      Future.wait.<anonymous closure> (dart:async/future.dart:525:21)
<asynchronous suspension>
#3      copyAssets (package:flutter_tools/src/build_system/targets/assets.dart:105:3)
<asynchronous suspension>
#4      WebReleaseBundle.build (package:flutter_tools/src/build_system/targets/web.dart:385:29)
<asynchronous suspension>
#5      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:847:9)
<asynchronous suspension>
#6      Future.wait.<anonymous closure> (dart:async/future.dart:525:21)
<asynchronous suspension>
#7      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:785:32)
<asynchronous suspension>
#8      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:614:16)
<asynchronous suspension>
#9      WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:81:34)
<asynchronous suspension>
#10     BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:191:5)
<asynchronous suspension>
#11     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1336:27)
<asynchronous suspension>
#12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150: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:296:9)
<asynchronous suspension>
#15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#16     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:244:5)
<asynchronous suspension>
#17     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:91:9)
<asynchronous suspension>
#18     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#19     main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>

Compiling lib/main.dart for the Web...                           1,664ms
Exception: Failed to compile application for the Web.


Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: invalidIssue is closed as not valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions