Skip to content

error TS2420: Class 'StreamableHTTPServerTransport' incorrectly implements interface 'Transport'. #1314

@jetbuster

Description

@jetbuster

I've updated to 1.25.1, and I get

../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.d.ts:58:22 - error TS2420: Class 'StreamableHTTPServerTransport' incorrectly implements interface 'Transport'.
Types of property 'onclose' are incompatible.
Type '(() => void) | undefined' is not assignable to type '() => void'.
Type 'undefined' is not assignable to type '() => void'.

58 export declare class StreamableHTTPServerTransport implements Transport {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error.

I suspect this is due to "exactOptionalPropertyTypes": true in my tsconfig.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Nice to haves, rare edge casesbugSomething isn't workinghelp wantedContributions especially welcome if you have a good knowledge of the codebase and language

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions