Dart-Code
Dart-Code copied to clipboard
VSCode Dart extension issue
This begun immediately after the most recent OSX 12.5.1 update. Another member on my team is seeing the same issue on a different machine. The dart analyzer plugin no longer functions at all -- files will attempt to save forever, it will not analyze the files, makes it prohibitive to write dart in vscode.
debugging attempts:
- re-grant VScode full disk permissions
- restart computer
- reinstall vscode
- change dart/flutter plugin versions (both downgrade and pre-release)
- re-install dart/flutter
Details
- Issue Type:
Bug - Extension Name:
dart-code - Extension Version:
3.44.0 - OS Version:
Darwin arm64 21.6.0 - VS Code version:
1.70.2
{
"messages": [],
"activationTimes": {
"codeLoadingTime": 40,
"activateCallTime": 5,
"activateResolvedTime": 157,
"activationReason": {
"startup": true,
"extensionId": {
"value": "Dart-Code.dart-code",
"_lower": "dart-code.dart-code"
},
"activationEvent": "workspaceContains:*/pubspec.yaml,*/*/pubspec.yaml,*.dart,*/*.dart,*/*/*.dart"
}
},
"runtimeErrors": [
{
"name": "Error",
"message": "Header must provide a Content-Length property."
}
],
"runningLocation": {
"affinity": 0,
"kind": 1
}
}
occasionally this output is visible:
[Error - 11:30:42 AM] Stopping server failed
Error: Stopping the server timed out
at ~/.vscode/extensions/dart-code.dart-code-3.46.1/out/dist/extension.js:32350:23
I am having the same exact issue.
Flutter doctor returns:
[✓] Flutter (Channel stable, 3.0.4, on macOS 12.5.1 21G83 darwin-x64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) [!] Xcode - develop for iOS and macOS (Xcode 13.4.1) ✗ CocoaPods installed but not working. You appear to have CocoaPods installed but it is not working. This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it. This can usually be fixed by re-installing CocoaPods. To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] VS Code (version 1.70.2) [✓] Connected device (3 available) [✓] HTTP Host Availability
Can you try running the Dart: Open Extension Log command and see if there's anything interesting in there when this happens? Also check Help -> Toggle Developer Tools -> console to see if there is anything more detailed reported there.
Apparently I'm only on macOS 12.4, but I'll start an upgrade shortly to see if I can reproduce there.
@DanTup I don't see anything interesting looking in the extension log. The last few lines of input are pasted below; the rest of the log seems to just be the extension successfully locating the flutter and dart SDKs.
[10:33:34 AM] [General] [Info] Caching Pub package names from pub.dev...
[10:33:34 AM] [General] [Info] Analyzer:Startup timing: 295ms
[10:33:39 AM] [General] [Info] Returning cached results for project search
[10:33:39 AM] [General] [Info] Checking 11 projects for supported platforms
[10:33:39 AM] [General] [Info] Supported platforms for the workspace are ios, android, web
[10:33:39 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
As for the developer tools console, I see a bit more information:
mainThreadExtensionService.ts:79 [[object Object]]Header must provide a Content-Length property.
$onExtensionRuntimeError @ mainThreadExtensionService.ts:79
mainThreadExtensionService.ts:80 Error: Header must provide a Content-Length property.
at StreamMessageReader.onData (vscode-file://vscode-app/Users/mateo/.vscode/extensions/dart-code.dart-code-3.44.0/out/dist/extension.js:30224:27)
at LoggingTransform.<anonymous> (vscode-file://vscode-app/Users/mateo/.vscode/extensions/dart-code.dart-code-3.44.0/out/dist/extension.js:30208:18)
at LoggingTransform.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at LoggingTransform.Readable.push (node:internal/streams/readable:228:10)
at LoggingTransform._transform (vscode-file://vscode-app/Users/mateo/.vscode/extensions/dart-code.dart-code-3.44.0/out/dist/extension.js:5762:14)
at LoggingTransform.Transform._write (node:internal/streams/transform:184:23)
at writeOrBuffer (node:internal/streams/writable:389:12)
at _write (node:internal/streams/writable:330:10)
at LoggingTransform.Writable.write (node:internal/streams/writable:334:10)
at Socket.ondata (node:internal/streams/readable:754:22)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:199:23)
console.ts:137 [Extension Host] rejected promise not handled within 1 second: Error: Stopping the server timed out
I @ console.ts:137
console.ts:137 [Extension Host] stack trace: Error: Stopping the server timed out
at /Users/mateo/.vscode/extensions/dart-code.dart-code-3.44.0/out/dist/extension.js:32253:23
mainThreadExtensionService.ts:79 [[object Object]]Stopping the server timed out
$onExtensionRuntimeError @ mainThreadExtensionService.ts:79
mainThreadExtensionService.ts:80 Error: Stopping the server timed out
at vscode-file://vscode-app/Users/mateo/.vscode/extensions/dart-code.dart-code-3.44.0/out/dist/extension.js:32253:23
$onExtensionRuntimeError @ mainThreadExtensionService.ts:80
mainThreadExtensionService.ts:79 [[object Object]]Header must provide a Content-Length property.
This sounds like the analysis server might be outputting something that isn't valid LSP. Can you try enabling the analysis server log in your workspace settings and see what's logged? (note: this log could include parts of your source files, so it's best to test on a new sample project or review the log before attaching).
@DanTup I tried this in a new project and was unable to reproduce the error. Interestingly, we are using a monorepo with a number of distinct flutter packages contained, and when I opened the projects individually, I also did not see the error. I wonder if it has something to do with the size of the repo?
Anything specific I should look for in this log file? it's enormous, and I'm not sure how to remove the massive quantity of sensitive data without also eliminating anything that would be helpful.
Anything specific I should look for in this log file? it's enormous
How soon after opening does the issue occur? I assumed it was crashing at startup and expected a fairly small log, but now I'm not sure if that's the case. Do you see any references to "shutdown" in there or any lines containing "error"?
One of the first few lines probably includes "initialized".. everything up until that point might be helpful to see the server startup (and hopefully isn't too much to ensure doesn't contain anything sensitive). You may need to increase the log line length to avoid them being truncated though.
Some other things that may be worth trying:
- check whether you have anything in
.vscode/folder (or.code-workspacefiles if you're using them) that might explain the difference between this project and the sample project - clone your project into a new folder (so that it has no
.dart_tool,build, etc. folders) and see if it reproduces there (if not, it might be caused by something in one of those folders) - try to reduce a copy of your main project to the smallest cast that still reproduces it (presumably at some point after deleting code it would stop occurring, because you'd end up with essentially the same as the new sample project)
@DanTup Here is everything up until "initialized":
!! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 3.44.0
Flutter extension: 3.46.0 (activated)
App: Visual Studio Code
Version: 1.70.2
Platform: mac
HTTP_PROXY: undefined
NO_PROXY: undefined
Logging Categories:
Analyzer
Tue Aug 23 2022 [13:08:59 GMT-0700 (Pacific Daylight Time)] Log file started
[1:08:59 PM] [Analyzer] [Info] Spawning /Users/mateo/flutter/bin/cache/dart-sdk/bin/dart with args ["language-server","--protocol=lsp","--client-id=VS-Code","--client-version=3.44.0"]
[1:08:59 PM] [Analyzer] [Info] PID: 57606
[1:08:59 PM] [Analyzer] [Info] ==> Content-Length: 6227
[1:08:59 PM] [Analyzer] [Info] ==> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":57435,"clientInfo":{"name":"Visual Studio Code","version":"1.70.2"},"locale":"en-us","rootPath":"/Users/mateo/point-of-sale","rootUri":"file:///Users/mateo/point-of-sale","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"configuration":true,"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]},"resolveSupport":{"properties":["location.range"]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"didChangeConfiguration":{"dynamicRegistration":true},"workspaceFolders":true,"semanticTokens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true},"inlineValue":{"refreshSupport":true},"inlayHint":{"refreshSupport":true},"diagnostics":{"refreshSupport":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]},"labelDetailsSupport":true},"ins…
[1:08:59 PM] [Analyzer] [Info] <== {"method":"textDocument/publishDiagnostics","params":{"uri":*REMOVED*,"diagnostics":[]},"jsonrpc":"2.0"}
[1:08:59 PM] [Analyzer] [Info] <== Content-Length: 214
Content-Type: application/vscode-jsonrpc; charset=utf-8
[1:08:59 PM] [Analyzer] [Info] <== {"method":"textDocument/publishDiagnostics","params":{"uri":*REMOVED*,"diagnostics":[]},"jsonrpc":"2.0"}
[1:08:59 PM] [Analyzer] [Info] <== Content-Length: 202
Content-Type: application/vscode-jsonrpc; charset=utf-8
[1:08:59 PM] [Analyzer] [Info] <== {"method":"textDocument/publishDiagnostics","params":{"uri":*REMOVED*,"diagnostics":[]},"jsonrpc":"2.0"}
[1:08:59 PM] [Analyzer] [Info] <== Content-Length: 228
Content-Type: application/vscode-jsonrpc; charset=utf-8
[1:08:59 PM] [Analyzer] [Info] <== {"method":"textDocument/publishDiagnostics","params":{"uri":*REMOVED*,"diagnostics":[]},"jsonrpc":"2.0"}
[1:08:59 PM] [Analyzer] [Info] <== Content-Length: 38
Content-Type: application/vscode-jsonrpc; charset=utf-8
{"id":1,"jsonrpc":"2.0","result":null}
[1:08:59 PM] [Analyzer] [Info] <== Content-Length: 248
Content-Type: application/vscode-jsonrpc; charset=utf-8
[1:08:59 PM] [Analyzer] [Info] ==> Content-Length: 67
[1:08:59 PM] [Analyzer] [Info] ==> {"jsonrpc":"2.0","method":"exit","clientRequestTime":1661285339694}
[1:08:59 PM] [Analyzer] [Info] <== {"method":"textDocument/publishDiagnostics","params":{"uri":*REMOVED*,"diagnostics":[]},"jsonrpc":"2.0"}
[1:08:59 PM] [Analyzer] [Info] <== Content-Length: 230
Content-Type: application/vscode-jsonrpc; charset=utf-8
[1:08:59 PM] [Analyzer] [Info] <== {"method":"textDocument/publishDiagnostics","params":{"uri":"*REMOVED*","diagnostics":[]},"jsonrpc":"2.0"}
[1:08:59 PM] [Analyzer] [Info] <== Content-Length: 398
Content-Type: application/vscode-jsonrpc; charset=utf-8
[1:08:59 PM] [Analyzer] [Info] <== {"id":0,"jsonrpc":"2.0","result":{"capabilities":{"executeCommandProvider":{"commands":["edit.sortMembers","edit.organizeImports","edit.fixAll","edit.sendWorkspaceEdit","refactor.perform"],"workDoneProgress":true},"workspaceSymbolProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}},"serverInfo":{"name":"Dart SDK LSP Analysis Server","version":"2.17.5"}}}
[1:08:59 PM] [Analyzer] [Info] ==> Content-Length: 86
[1:08:59 PM] [Analyzer] [Info] ==> {"jsonrpc":"2.0","method":"initialized","params":{},"clientRequestTime":1661285339780}
I'll try those other suggestions and get back to you. thank you!
Thanks - I can't see anything obviously wrong there, although I can see VS Code asking the server to exit (it's not clear why):
It may be worth enabling the general extension log and reproducing the issue too, and seeing whether it looks like the extension is trying to restart (this is one thing that would cause the analysis server to be shutdown and restarted, although it should only occur in some specific cases, and usually only after some sort of prompt or something).
Experimenting, I was able to see some pretty inconsistent behavior -- it doesn't seem like one specific project or folder within the mono is causing the error, but if I delete a bunch of stuff and restart the analysis server, everything seems to once again work as expected.
I enabled the general extension log while I was testing, but was never able to get any output that looked very interesting. I've attached it anyway.
!! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 3.44.0
Flutter extension: 3.46.0 (activated)
App: Visual Studio Code
Version: 1.70.2
Platform: mac
HTTP_PROXY: undefined
NO_PROXY: undefined
Logging Categories:
General
Tue Aug 23 2022 [13:46:23 GMT-0700 (Pacific Daylight Time)] Log file started
[1:46:23 PM] [General] [Info] Searching for SDKs...
[1:46:23 PM] [General] [Info] Environment PATH:
[1:46:23 PM] [General] [Info] /Users/mateo/.rbenv/shims
[1:46:23 PM] [General] [Info] /Users/mateo/bin
[1:46:23 PM] [General] [Info] /usr/local/bin
[1:46:23 PM] [General] [Info] /opt/homebrew/bin
[1:46:23 PM] [General] [Info] /opt/homebrew/sbin
[1:46:23 PM] [General] [Info] /usr/local/bin
[1:46:23 PM] [General] [Info] /usr/bin
[1:46:23 PM] [General] [Info] /bin
[1:46:23 PM] [General] [Info] /usr/sbin
[1:46:23 PM] [General] [Info] /sbin
[1:46:23 PM] [General] [Info] /Library/Apple/usr/bin
[1:46:23 PM] [General] [Info] /Users/mateo/.banjo/bin
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin
[1:46:23 PM] [General] [Info] /Users/mateo/.banjo/bin
[1:46:23 PM] [General] [Info] Returning cached results for project search
[1:46:23 PM] [General] [Info] Found Flutter project at *REMOVED*:
Mobile? true
Web? false
Create Trigger? false
Flutter Repo? false
[1:46:23 PM] [General] [Info] Searching for flutter
[1:46:23 PM] [General] [Info] Looking for flutter in:
[1:46:23 PM] [General] [Info] *REMOVED*
[1:46:23 PM] [General] [Info] *REMOVED*r/bin
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin/
[1:46:23 PM] [General] [Info] *REMOVED*/.flutter
[1:46:23 PM] [General] [Info] *REMOVED*/.flutter/bin
[1:46:23 PM] [General] [Info] *REMOVED*/vendor/flutter
[1:46:23 PM] [General] [Info] *REMOVED*/vendor/flutter/bin
[1:46:23 PM] [General] [Info] /Users/mateo/flutter-sdk
[1:46:23 PM] [General] [Info] /Users/mateo/flutter-sdk/bin
[1:46:23 PM] [General] [Info] /google/flutter
[1:46:23 PM] [General] [Info] /google/flutter/bin
[1:46:23 PM] [General] [Info] /Users/mateo/.rbenv/shims
[1:46:23 PM] [General] [Info] /Users/mateo/.rbenv/shims/bin
[1:46:23 PM] [General] [Info] /Users/mateo/bin
[1:46:23 PM] [General] [Info] /usr/local/bin
[1:46:23 PM] [General] [Info] /opt/homebrew/bin
[1:46:23 PM] [General] [Info] /opt/homebrew/sbin
[1:46:23 PM] [General] [Info] /usr/local/bin
[1:46:23 PM] [General] [Info] /usr/bin
[1:46:23 PM] [General] [Info] /bin
[1:46:23 PM] [General] [Info] /usr/sbin
[1:46:23 PM] [General] [Info] /sbin
[1:46:23 PM] [General] [Info] /Library/Apple/usr/bin
[1:46:23 PM] [General] [Info] /Users/mateo/.banjo/bin
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin
[1:46:23 PM] [General] [Info] /Users/mateo/.banjo/bin
[1:46:23 PM] [General] [Info] Found at:
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin/
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin
[1:46:23 PM] [General] [Info] Candidate paths to be post-filtered:
[1:46:23 PM] [General] [Info] /Users/mateo/flutter
[1:46:23 PM] [General] [Info] /Users/mateo/flutter
[1:46:23 PM] [General] [Info] Found at /Users/mateo/flutter
[1:46:23 PM] [General] [Info] Returning SDK path /Users/mateo/flutter for flutter
[1:46:23 PM] [General] [Info] Searching for dart
[1:46:23 PM] [General] [Info] Looking for dart in:
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin/cache/dart-sdk
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin/cache/dart-sdk/bin
[1:46:23 PM] [General] [Info] /Users/mateo/.rbenv/shims
[1:46:23 PM] [General] [Info] /Users/mateo/.rbenv/shims/bin
[1:46:23 PM] [General] [Info] /Users/mateo/bin
[1:46:23 PM] [General] [Info] /usr/local/bin
[1:46:23 PM] [General] [Info] /opt/homebrew/bin
[1:46:23 PM] [General] [Info] /opt/homebrew/sbin
[1:46:23 PM] [General] [Info] /usr/local/bin
[1:46:23 PM] [General] [Info] /usr/bin
[1:46:23 PM] [General] [Info] /bin
[1:46:23 PM] [General] [Info] /usr/sbin
[1:46:23 PM] [General] [Info] /sbin
[1:46:23 PM] [General] [Info] /Library/Apple/usr/bin
[1:46:23 PM] [General] [Info] /Users/mateo/.banjo/bin
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin
[1:46:23 PM] [General] [Info] /Users/mateo/.banjo/bin
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin/cache/dart-sdk
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin/cache/dart-sdk/bin
[1:46:23 PM] [General] [Info] Found at:
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin/cache/dart-sdk/bin
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin/cache/dart-sdk/bin
[1:46:23 PM] [General] [Info] Candidate paths to be post-filtered:
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin/cache/dart-sdk
[1:46:23 PM] [General] [Info] /Users/mateo/flutter
[1:46:23 PM] [General] [Info] /Users/mateo/flutter/bin/cache/dart-sdk
[1:46:23 PM] [General] [Info] Found at /Users/mateo/flutter/bin/cache/dart-sdk
[1:46:23 PM] [General] [Info] Returning SDK path /Users/mateo/flutter/bin/cache/dart-sdk for dart
[1:46:23 PM] [General] [Info] !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 3.44.0
Flutter extension: 3.46.0 (activated)
App: Visual Studio Code
Version: 1.70.2
Platform: mac
Workspace type: Flutter
Analyzer type: LSP
Multi-root?: false
Dart SDK:
Loc: /Users/mateo/flutter/bin/cache/dart-sdk
Ver: 2.17.5
Flutter SDK:
Loc: /Users/mateo/flutter
Ver: 3.0.4
HTTP_PROXY: undefined
NO_PROXY: undefined
[1:46:23 PM] [General] [Info] Returning cached results for project search
[1:46:23 PM] [General] [Info] Activating Flutter extension for Flutter project...
[1:46:23 PM] [General] [Info] Extension:Startup timing: 15ms
[1:46:23 PM] [General] [Info] Found 0 folders requiring "pub get":
[1:46:23 PM] [General] [Info] Done!
[1:46:23 PM] [General] [Info] !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 3.44.0
Flutter extension: 3.46.0 (activated)
App: Visual Studio Code
Version: 1.70.2
Platform: mac
Workspace type: Flutter
Analyzer type: LSP
Multi-root?: false
Dart SDK:
Loc: /Users/mateo/flutter/bin/cache/dart-sdk
Ver: 2.17.5
Flutter SDK:
Loc: /Users/mateo/flutter
Ver: 3.0.4
HTTP_PROXY: undefined
NO_PROXY: undefined
[1:46:23 PM] [General] [Info] Caching Pub package names from pub.dev...
[1:46:23 PM] [General] [Info] Analyzer:Startup timing: 283ms
[1:46:28 PM] [General] [Info] Returning cached results for project search
[1:46:28 PM] [General] [Info] Checking 10 projects for supported platforms
[1:46:28 PM] [General] [Info] Supported platforms for the workspace are ios, android
[1:46:29 PM] [General] [Info] Analyzer:FirstAnalysis timing: 5590ms
[1:47:28 PM] [General] [Info] Pubspec *REMOVED*/pubspec.yaml was modified
[1:47:28 PM] [General] [Info] Pubspec *REMOVED*/pubspec.yaml was modified
[1:47:28 PM] [General] [Info] Pubspec *REMOVED*/pubspec.yaml was modified
[1:47:28 PM] [General] [Info] Pubspec *REMOVED*/pubspec.yaml was modified
[1:47:28 PM] [General] [Info] Pubspec *REMOVED*/pubspec.yaml was modified
[1:47:28 PM] [General] [Info] Pubspec *REMOVED*/pubspec.yaml was modified
[1:47:29 PM] [General] [Info] Pubspec *REMOVED*/peripheral_flutter/pubspec.yaml was modified
[1:47:29 PM] [General] [Info] Pubspec *REMOVED*/pubspec.yaml was modified
[1:47:29 PM] [General] [Info] Pubspec *REMOVED*/pubspec.yaml was modified
[1:47:29 PM] [General] [Info] Pubspec *REMOVED*/pubspec.yaml was modified
[1:47:30 PM] [General] [Info] Returning cached results for project search
[1:47:30 PM] [General] [Info] Found 10 folders requiring "pub get":
*REMOVED DIRECTORIES*
@mateominato was that log file taken when the issue was occurring? (if so, do you know what time the error occurred?).
And out of interest, did you modify all those pubspec.yaml files at 1:47:28? I doubt it's related to the issue, but if looks odd.
@DanTup yes, i looked at the file right after i saw the content length error pop up in developer tools. this was right after i restored a bunch of directories i had temporarily deleted to see if I could root cause, thus all the modified pubspecs.
@mateominato could you try increasing the log line length can capture a log again the next time it occurs. Then provide anything that comes before the line that looks like:
{"jsonrpc":"2.0","method":"exit","clientRequestTime":1661285339694}
In the original log above this was only a small number of lines, but some of them are truncated so it's hard for me to match up the lengths with what's being sent. If you need to remove anything (like file paths), can you replace them with an equivalent number of placeholder characters, so the lengths will still remain in-tact (in case there is a difference between the header and the content).
Thanks!
This issue has been marked stale because it is tagged awaiting-info for 20 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.
I'm also experiencing the same issue. Here is the last few logs I got from the extension:
Dart Code extension: 3.48.4
Flutter extension: 3.48.0 (not activated)
App: Visual Studio Code
Version: 1.71.2
Platform: linux
Workspace type: Flutter
Analyzer type: LSP
Multi-root?: false
Dart SDK:
Loc: /home/randomUser/flutter/bin/cache/dart-sdk
Ver: 2.18.1
Flutter SDK:
Loc: /home/randomUser/flutter
Ver: 3.3.2
HTTP_PROXY: undefined
NO_PROXY: undefined
[12:38:45 PM] [General] [Info] Returning cached results for project search
[12:38:45 PM] [General] [Info] Activating Flutter extension for Flutter project...
[12:38:45 PM] [General] [Info] Extension:Startup timing: 356ms
[12:38:45 PM] [General] [Info] Found 0 folders requiring "pub get":
[12:38:45 PM] [General] [Info] Caching Pub package nPMes from pub.dev...
[12:38:45 PM] [General] [Info] !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 3.48.4
Flutter extension: 3.48.0 (activated)
App: Visual Studio Code
Version: 1.71.2
Platform: linux
Workspace type: Flutter
Analyzer type: LSP
Multi-root?: false
Dart SDK:
Loc: /home/randomUser/flutter/bin/cache/dart-sdk
Ver: 2.18.1
Flutter SDK:
Loc: /home/randomUser/flutter
Ver: 3.3.2
HTTP_PROXY: undefined
NO_PROXY: undefined
[12:38:45 PM] [General] [Info] Analyzer:Startup timing: 448ms
[12:38:49 PM] [General] [Info] Returning cached results for project search
[12:38:49 PM] [General] [Info] Checking 1 projects for supported platforms
[12:38:49 PM] [General] [Info] Supported platforms for the workspace are windows, ios, android, web
[12:38:49 PM] [General] [Info] Returning cached promise for getSupportedPlatforms()
@DanTup Looks like the analysis will work after 6 minutes of waiting. I got an extra log from the dart extension.
[12:44:42 PM] [General] [Info] Analyzer:FirstAnalysis timing: 139489ms
@CoderUni can you try enabling the instrumentation log and see what's being logged before/during that period?
Thanks @DanTup. I emailed the logs to [email protected]
@CoderUni thanks, I got the log - and I can see around 6 minutes between the server initializing and it started to report results, and then around another 5 minutes for the first analysis to complete. Unfortunately there's not much logged that indicates why.
Can you confirm how big the workspace is you have open, and what sort of disk/filesystem it's on (for example is it a mechanical hdd, or a remote workspace, or something?). The results seem like what would occur if the file system was very slow, or the project was very large (although I'm not sure if either are the case).
Could you also confirm this wasn't just after you'd upgraded Flutter/Dart (since the first time after an upgrade, things will be slower than usual - although certainly not normally this slow).
And finally, could you send me the output of running code --status while you have this project open after analysis has completed?
Thanks!
Thanks @DanTup, I sent the code --status logs to [email protected]
@CoderUni I don't seem to have your email, although I got the output from a notification of your original message.
I think this is a different issue to the originally reported issue above here (which includes "Header must provide a Content-Length property.") so I've opened https://github.com/Dart-Code/Dart-Code/issues/4180 where we can continue to debug this.
This issue has been marked stale because it is tagged awaiting-info for 20 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.