Open walsha2 opened 2 weeks ago
I'm already aware of this bug. See https://github.com/flutter/flutter/issues/149267 They fixed it on master but the fix has no reached stable yet. You have two options for now:
This is just temporary, we need to wait a little bit for the fix to reach stable
Full Working Example:
Can be found on my fork, in the
web-tree-shake
branch:https://github.com/walsha2/flutter-shadcn-ui/tree/web-tree-shake/app
Steps to reproduce
Steps to create can be found bellow. Just a bare bones
flutter create
app withshadcn_ui
add as a dependency and theMateiralApp
converted to aShadApp
. No other changes to the cannedflutter create
app.Expected results
Build succeeds without error. I can get it to work with
--no-tree-shake-icons
, but that bloats the delivered assets and none of the icons are tree shaken.Actual results
shadcn_ui version
main
Platform
Web
Code sample
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]Logs
Logs
```console >>> flutter build web --release --tree-shake-icons Target web_release_bundle failed: IconTreeShakerException: Invalid ConstFinder result. Expected "fontPackage" to be a String, "fontFamily" to be a String, and "codePoint" to be an int, got: {codePoint: 9658.0, fontFamily: null, fontPackage: null, matchTextDirection: false, fontFamilyFallback: null}. To disable icon tree shaking, pass --no-tree-shake-icons to the requested flutter build command #0 IconTreeShaker._parseConstFinderResult (package:flutter_tools/src/build_system/targets/icon_tree_shaker.dart:333:9) #1 IconTreeShaker._findConstants (package:flutter_tools/src/build_system/targets/icon_tree_shaker.dart:321:12)Flutter Doctor output
Doctor output
```console Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.22.3, on macOS 14.6.1 23G93 darwin-arm64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.92.2) [✓] Connected device (3 available) [✓] Network resources ```