question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Exception from the Dart analysis server" on start up

See original GitHub issue

Describe the bug Crash on start up, VS Code integration then doesn’t work fully anymore (e.g. formatting works, but no auto-complete/linting).

To Reproduce

Open our internal app project, a VS Code Workspace.

Expected behavior Initializes normally, as it did for over a year.

Screenshots

image

Versions (please complete the following information):

Error log:


### Request

Server was responding to request: `analysis.setAnalysisRoots`

### Versions

- Visual Studio Code v1.59.1
- Dart Code v3.25.1
- Flutter SDK v1.22.6

### Analyzer Info

The analyzer was launched using the arguments:

- /Users/timm-l1/Downloads/flutter/bin/cache/dart-sdk/bin/snapshots/analysis_server.dart.snapshot
- --client-id=VS-Code
- --client-version=3.25.1

### Exception

type '_OverlayFolder' is not a subtype of type 'File'

#0      ContextManagerImpl._findPackageSpecFile (package:analysis_server/src/context_manager.dart:1093:5)
#1      ContextManagerImpl._createContexts (package:analysis_server/src/context_manager.dart:998:23)
#2      ContextManagerImpl.setRoots (package:analysis_server/src/context_manager.dart:610:9)
#3      AnalysisServer.setAnalysisRoots (package:analysis_server/src/analysis_server.dart:398:22)
#4      AnalysisDomainHandler.setAnalysisRoots (package:analysis_server/src/domain_analysis.dart:350:14)
#5      AnalysisDomainHandler.handleRequest (package:analysis_server/src/domain_analysis.dart:289:16)
#6      AnalysisServer.handleRequest.<anonymous closure> (package:analysis_server/src/analysis_server.dart:239:38)
#7      _rootRun (dart:async/zone.dart:1190:13)
#8      _CustomZone.run (dart:async/zone.dart:1093:19)
#9      _runZoned (dart:async/zone.dart:1630:10)
#10     runZonedGuarded (dart:async/zone.dart:1618:12)
#11     AnalysisServer.handleRequest (package:analysis_server/src/analysis_server.dart:235:5)
#12     ByteStreamServerChannel._readRequest (package:analysis_server/src/channel/byte_stream_channel.dart:163:14)
#13     ByteStreamServerChannel.listen.<anonymous closure> (package:analysis_server/src/channel/byte_stream_channel.dart:103:26)
#14     _rootRunUnary (dart:async/zone.dart:1198:47)
#15     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#16     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
#17     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#18     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
#19     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:69:11)
#20     _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#21     _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)
#22     _LineSplitterSink._addLines (dart:convert/line_splitter.dart:155:13)
#23     _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:130:5)
#24     StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5)
#25     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:121:24)
#26     _rootRunUnary (dart:async/zone.dart:1198:47)
#27     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#28     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
#29     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#30     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
#31     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:69:11)
#32     _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#33     _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)
#34     _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243:7)
#35     _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317:20)
#36     _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)
#37     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
#38     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:121:24)
#39     _rootRunUnary (dart:async/zone.dart:1198:47)
#40     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#41     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
#42     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#43     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
#44     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:808:19)
#45     _StreamController._add (dart:async/stream_controller.dart:682:7)
#46     _StreamController.add (dart:async/stream_controller.dart:624:5)
#47     _Socket._onData (dart:io-patch/socket_patch.dart:2044:41)
#48     _rootRunUnary (dart:async/zone.dart:1206:13)
#49     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#50     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
#51     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#52     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
#53     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:808:19)
#54     _StreamController._add (dart:async/stream_controller.dart:682:7)
#55     _StreamController.add (dart:async/stream_controller.dart:624:5)
#56     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1580:33)
#57     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1076:14)
#58     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#59     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#60     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#61     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tpcommented, Aug 25, 2021

Sounds reasonable. Thanks for your support.

Indeed we’re looking into moving to Flutter 2.x first without NNBD which shouldn’t be a major task, we’re just getting started a bit “late”.

If I find any workaround / solution for my current other than open individual editors, I will update the thread here.

1reaction
DanTupcommented, Aug 25, 2021

Do you think there could be any inadvertent side-effect of opening a project with a Flutter 2.x SDK which now affects this project?

I wouldn’t expect so, although depending on how you’re switching between SDKs, is it possible you have an inconsistent SDK with some files from each?

Unfortunately there’s not much that can be done if it’s legitimately a bug in the older SDK, as any fixes would only be available in newer versions anyway.

I’m not familiar with the changes required to migrate to Flutter 2.0, but if null-safety is the large part of the work you have, my understanding was that it’s possible to upgrade to Flutter 2.0 without using sound null safety, so that might not be as big a job as migrating to null safety. (I’m not familiar with what other breaking changes there may be in the upgrade though).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dart Analysis server has terminated - Stack Overflow
I develop in Flutter for 1 year and suddenly I faced this error after launching IntelliJ IDEA. The Dart analysis has stopped to...
Read more >
Customizing static analysis - Dart
This document explains how to customize the behavior of the analyzer using either an analysis options file or comments in Dart source code....
Read more >
v0.14 - Dart Code - Dart & Flutter support for Visual Studio Code
If the analysis server encounters an error you will now be prompted (up to 3 times per session) to report the issue to...
Read more >
analyzer | Dart Package - Pub.dev
This package provides a library that performs static analysis of Dart code. It is useful for tool integration and embedding. End-users should use...
Read more >
Dart Analysis tool window | PhpStorm Documentation - JetBrains
Click this button to kill the Dart Analysis server and then start it. ... the file that contains the selected error automatically opens...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found