Skip to content

Missing Content-Length property in header #2102

@wes-sleeman

Description

@wes-sleeman

Describe the bug

In any F# file referencing a type provider, any attempt to format hangs indefinitely. Opening the VS Code developer tools reveals errors in the console saying [Ionide.Ionide-fsharp]Header must provide a Content-Length property. followed by a separate message with a stack trace:

Error: Header must provide a Content-Length property.
    at m.onData (/root/.vscode-server/extensions/ionide.ionide-fsharp-7.26.6/webpack:/node_modules/vscode-jsonrpc/lib/common/messageReader.js:137:27)
    at Socket.<anonymous> (/root/.vscode-server/extensions/ionide.ionide-fsharp-7.26.6/webpack:/node_modules/vscode-jsonrpc/lib/common/messageReader.js:121:18)
    at Socket.emit (node:events:518:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Socket.Readable.push (node:internal/streams/readable:392:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)

The only way to get out of the loop is killall dotnet.

Steps to reproduce

  1. Create a basic FSX.
  2. Reference a type provider such as SwaggerProvider.
  3. Open the namespace and create a type.
  4. Attempt to format the document.
  5. If it works, wait a couple minutes and hit the format button again.

Link to sample reproduction

#r "nuget: SwaggerProvider"

open SwaggerProvider

type Api = OpenApiClientProvider<"https://github.com/OAI/learn.openapis.org/raw/refs/heads/main/examples/v3.0/api-with-examples.json">

Expected behaviour

I expect the document format command to complete and for the formatting popup to go away.

Machine infos

  • OS: WSL (Ubuntu 25.04)
  • .NET SDK version: 10.0.100-preview.7
  • Ionide version: 7.26.6

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions