Troubleshooting
“Not a Flutter app”
Section titled ““Not a Flutter app””Run from the project root (where pubspec.yaml is), or pass --path.
Files not updating
Section titled “Files not updating”Existing files are skipped by default. Use --overwrite, or sync for router/DI markers.
Analyze failures
Section titled “Analyze failures”The quality gate fails when dart analyze exits non-zero. Fix the reported issues, then re-run.
dart run stackchain doctorstrict_quality: true also treats analyzer infos as fatal (--fatal-infos).
Localization / production_riverpod broken
Section titled “Localization / production_riverpod broken”Need flutter_localizations (SDK) and generate: true. Run:
dart run stackchain upgradeflutter pub getflutter gen-l10n # if neededDo not pin an old intl (e.g. ^0.19.0) — it conflicts with the Flutter SDK.
GetX routing/DI wrong
Section titled “GetX routing/DI wrong”Set them explicitly, or omit both while state_management: getx so defaults kick in.
AutoRoute / Injectable
Section titled “AutoRoute / Injectable”After pub get:
dart run build_runner build --delete-conflicting-outputsMigrate removed something I needed
Section titled “Migrate removed something I needed”Restore from git and re-run with --keep-old. Look for *.stackchain.bak backups if a legacy unmarked file was replaced.
Custom code disappeared after migrate
Section titled “Custom code disappeared after migrate”- Feature logic →
// <stackchain:custom>in presentation/state classes - Don’t put irreplaceable code in
bootstrap.dart/main*.dart/app.dart(those are rewritten) - Router/DI hand-written code outside markers survives state-only migrates
Pages still use old Bloc after migrate to Cubit
Section titled “Pages still use old Bloc after migrate to Cubit”Upgrade to 1.3.1+. Then:
dart run stackchain migrate --state cubit# or heal one feature:dart run stackchain feature auth --overwritetest says unknown feature
Section titled “test says unknown feature”Add it first: dart run stackchain feature auth, then dart run stackchain test auth.
Feature name rejected
Section titled “Feature name rejected”Use snake_case: user_profile, not UserProfile.
Can’t remove the last feature
Section titled “Can’t remove the last feature”Add another feature first, then remove the one you don’t want.