Dart-code: Dart analyzer has terminated

Created on 1 Feb 2021  Â·  11Comments  Â·  Source: Dart-Code/Dart-Code

Describe the bug
Dart analyzer stops working unexpectedly

To Reproduce
Steps to reproduce the behavior:

  1. Start VSCode and wait a little bit

Expected behavior
Don't crash

Screenshots
/

Versions (please complete the following information):
VS Code version: 1.52.1
Dart extension version: 3.18.1
Dart/Flutter SDK version:
Flutter 1.24.0-2.0.pre.45
Dart 2.11.0 (build 2.11.0-228.0.dev)

log-307a.txt

awaiting info is bug stale

All 11 comments

This does this only happen when you _run_ your Flutter app? There are no errors in the log, so it seems like the analyzer's VM may be terminated which sounds a bit like https://github.com/flutter/flutter/issues/46616. I would've expected your version of Flutter to include the fix for that though.

If you can reliably reproduce this, I would recommend:

  • Updating Flutter to the latest version of whichever branch you're on
  • Enable crash dumps in Windows (see https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps)
  • File an issue in the dart-lang/sdk repo

Thanks!

I had the same problem in the last few days. I resolved updating to flutter version 1.22.6
This also solved problems like slow auto-suggestions and running formatter freezes while pressing ctrl + S

@DanTup I feel like this should be solved with #3102 . At least it looks like the issue doesn't appear anymore when I turn off dart.previewLsp in VSCode.

@DanTup I feel like this should be solved with #3102 . At least it looks like the issue doesn't appear anymore when I turn off dart.previewLsp in VSCode.

I've set "dart.previewLsp": false and analyzer is still crashing on VSCode start-up.

"The Dart Analyzer has terminated."
log-74ab.txt

VS Code version: 1.53.1
Dart extension version: 3.19.2
Flutter extension version: 3.19.0
Dart/Flutter SDK version:
Flutter 1.25.0-8.3.pre • channel beta
Dart 2.12.0 (build 2.12.0-133.7.beta)

@ffpetrovic is the issue a crash, or just performance? If the analyzer is _terminating_ under LSP, that sounds like a serious bug that needs fixing (and is unlikely the same perf issue noted at https://github.com/Dart-Code/Dart-Code/issues/3102).

@nwtnwrkshp your issue looks like https://github.com/dart-lang/sdk/issues/44299 (which may be related to https://github.com/dart-lang/sdk/issues/44785). Do you have any invalid code (perhaps using and or or instead of &&/||)?

If you can are able to reproduce it on a build that includes the fix for https://github.com/dart-lang/sdk/issues/44785 (which is likely only Flutter master or a nightly Dart build right now), please file an issue at https://github.com/dart-lang/sdk with details.

@DanTup you are exactly right! My issue is related to dart-lang/sdk#44299 - having and instead of && - once I removed it, analyzer started working perfectly again!

Sorry to have wasted time on this, thanks for your help.

@nwtnwrkshp great! No worries, it's not a waste of time - duplicated reports are better than potentially missing issues :-)

This issue has been marked stale because it is tagged awaiting-info for 30 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.

@DanTup you are exactly right! My issue is related to dart-lang/sdk#44299 - having and instead of && - once I removed it, analyzer started working perfectly again!

Sorry to have wasted time on this, thanks for your help.

Ive just run into this problem and resolved it by your help. So definitely not a waste of time!

l have just run into this problem
please tell me where and how you made this fix. l cannot find any of my code with this problem.

@OceanManta please file a new issue and include the log file (which is accessible from the button on the error message) and I'll take a look. Thanks!

Was this page helpful?
0 / 5 - 0 ratings