Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] LateError (LateInitializationError: Field '_currentProperty@340066930' has not been initialized. #1232

Closed
FabienZE opened this issue Feb 23, 2023 · 1 comment
Labels
bug Something isn't working css Enhancements/issues with css properties duplicate This issue or pull request already exists

Comments

@FabienZE
Copy link

Describe the bug:
When loading HTML data with @media queries css parser failed with a lateinitialization error

HTML to reproduce the issue:
The css that fails is :

@media all and (max-width: 480px){*[class].ib_t{min-width:100% !important}*[class].ib_row{display:block !important}*[class].ib_ext{display:block !important;padding:10px 0 5px 0;vertical-align:top !important;width:100% !important}*[class].ib_img,*[class].ib_mid{vertical-align:top !important}*[class].mb_blk{display:block !important;padding-bottom:10px;width:100% !important}*[class].mb_hide{display:none !important}*[class].mb_inl{display:inline !important}*[class].d_mb_flex{display:block !important}}.d_mb_show{display:none}.d_mb_flex{display:flex}@media only screen and (max-device-width: 480px){.d_mb_hide{display:none !important}.d_mb_show{display:block !important}.d_mb_flex{display:block !important}}.mb_text h1,.mb_text h2,.mb_text h3,.mb_text h4,.mb_text h5,.mb_text h6{line-height:normal}.mb_work_text h1{font-size:18px;line-height:normal;margin-top:4px}.mb_work_text h2,.mb_work_text h3{font-size:16px;line-height:normal;margin-top:4px}.mb_work_text h4,.mb_work_text h5,.mb_work_text h6{font-size:14px;line-height:normal}.mb_work_text a{color:#1270e9}.mb_work_text p{margin-top:4px}@media all{*{-webkit-font-smoothing:antialiased}p a[href],li a[href],li strong a[href]{color:#3578e5;text-decoration:none}span.im{color:#4e5665}}

The container html is :

<html><head><meta charset="utf-8"><title>Facebook</title><style nonce="owl9ZwfM">@media all and (max-width: 480px){*[class].ib_t{min-width:100% !important}*[class].ib_row{display:block !important}*[class].ib_ext{display:block !important;padding:10px 0 5px 0;vertical-align:top !important;width:100% !important}*[class].ib_img,*[class].ib_mid{vertical-align:top !important}*[class].mb_blk{display:block !important;padding-bottom:10px;width:100% !important}*[class].mb_hide{display:none !important}*[class].mb_inl{display:inline !important}*[class].d_mb_flex{display:block !important}}.d_mb_show{display:none}.d_mb_flex{display:flex}@media only screen and (max-device-width: 480px){.d_mb_hide{display:none !important}.d_mb_show{display:block !important}.d_mb_flex{display:block !important}}.mb_text h1,.mb_text h2,.mb_text h3,.mb_text h4,.mb_text h5,.mb_text h6{line-height:normal}.mb_work_text h1{font-size:18px;line-height:normal;margin-top:4px}.mb_work_text h2,.mb_work_text h3{font-size:16px;line-height:normal;margin-top:4px}.mb_work_text h4,.mb_work_text h5,.mb_work_text h6{font-size:14px;line-height:normal}.mb_work_text a{color:#1270e9}.mb_work_text p{margin-top:4px}@media all{*{-webkit-font-smoothing:antialiased}p a[href],li a[href],li strong a[href]{color:#3578e5;text-decoration:none}span.im{color:#4e5665}}</style></head><body style="max-width:700px;margin:0 auto;" dir="ltr" bgcolor="#ffffff"></body></html>

Stacktrace/Logcat
DeclarationVisitor._currentProperty (hosted\pub.dev\flutter_html-3.0.0-alpha.6\lib\src\css_parser.dart:0)
DeclarationVisitor.visitExpressions (\hosted\pub.dev\flutter_html-3.0.0-alpha.6\lib\src\css_parser.dart:620)
Visitor.visitMediaExpression (\hosted\pub.dev\csslib-0.17.2\lib\visitor.dart:160)
Visitor.visitMediaQuery (\hosted\pub.dev\csslib-0.17.2\lib\visitor.dart:166)
MediaQuery.visit (\hosted\pub.dev\csslib-0.17.2\lib\src\tree.dart:737)
Visitor._visitNodeList (\hosted\pub.dev\csslib-0.17.2\lib\visitor.dart:126)
Visitor.visitMediaDirective (\hosted\pub.dev\csslib-0.17.2\lib\visitor.dart:209)
MediaDirective.visit (\hosted\pub.dev\csslib-0.17.2\lib\src\tree.dart:760)
DeclarationVisitor.getDeclarations (\hosted\pub.dev\flutter_html-3.0.0-alpha.6\lib\src\css_parser.dart:591)
....

@FabienZE FabienZE added the bug Something isn't working label Feb 23, 2023
@Sub6Resources Sub6Resources added css Enhancements/issues with css properties in-triage Issue's that I've seen but haven't had a chance to thoroughly review and/or categorize labels May 9, 2023
@Sub6Resources Sub6Resources added duplicate This issue or pull request already exists and removed in-triage Issue's that I've seen but haven't had a chance to thoroughly review and/or categorize labels May 18, 2023
@Sub6Resources
Copy link
Owner

Duplicate of #1060

@Sub6Resources Sub6Resources marked this as a duplicate of #1060 May 18, 2023
@Sub6Resources Sub6Resources closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working css Enhancements/issues with css properties duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants