Repository navigation
Set TextStyle(height: double.nan), App Crash #175248
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: typographyText rendering, possibly libtxtText rendering, possibly libtxtd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/found in release: 3.35Found to occur in 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37Found to occur in 3.37frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Steps to reproduce
- Build widget like : Text('text', style: TextStyle(height: x))
- The height 'x' is calculated and is exactly double.nan
- Reload my app
- Wait for about ten or so seconds, My app crashed
Expected results
I think the height is calculated and is exactly double.nan, It should be treated as null
Actual results
crashed
Code sample
Code sample
Text('text', style: TextStyle(height: x))
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.32.8, on macOS 15.0 24A335 darwin-arm64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0-rc3)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2025.1)
[✓] Proxy Configuration
[✓] Connected device (3 available)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: typographyText rendering, possibly libtxtText rendering, possibly libtxtd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/found in release: 3.35Found to occur in 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37Found to occur in 3.37frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Activity
tirth-patel-nc commentedon Sep 12, 2025
PaniniA commentedon Sep 12, 2025
PaniniA commentedon Sep 12, 2025
Text('data',style: TextStyle(fontSize: 0, height: 0 / 0)), Set the fontSize to 0 and the height to 0/0 at the same time, then wait for many seconds, My app crashed
AbdeMohlbi commentedon Sep 12, 2025
PaniniA commentedon Sep 12, 2025
AbdeMohlbi commentedon Sep 12, 2025
PaniniA commentedon Sep 12, 2025
AbdeMohlbi commentedon Sep 12, 2025
PaniniA commentedon Sep 12, 2025
tirth-patel-nc commentedon Sep 15, 2025
PaniniA commentedon Sep 15, 2025
21 remaining items
justinmc commentedon Sep 16, 2025
I guess this probably shouldn't work, but we should have a much better error message and a consistent outcome on every platform.
AbdeMohlbi commentedon Oct 1, 2025
I think this can be prevented by adding an assert to
text_style.dart?Assert TextStyle height is not NaN (flutter#186617)
github-actions commentedon Jul 24, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.