{"record":{"id":"340cf1a515ac60fe","repo":"vercel/ai","slug":"method-not-implemented","errorCode":null,"errorMessage":"Method not implemented.","messagePattern":"Method not implemented\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/langchain/src/transport.ts","lineNumber":86,"sourceCode":"  ): Promise<ReadableStream<UIMessageChunk>> {\n    const baseMessages = await toBaseMessages(options.messages);\n\n    const stream = await this.graph.stream(\n      { messages: baseMessages },\n      { streamMode: ['values', 'messages'] },\n    );\n\n    return toUIMessageStream(\n      stream as AsyncIterable<AIMessageChunk> | ReadableStream,\n    );\n  }\n\n  async reconnectToStream(\n    _options: {\n      chatId: string;\n    } & ChatRequestOptions,\n  ): Promise<ReadableStream<UIMessageChunk> | null> {\n    throw new Error('Method not implemented.');\n  }\n}\n","sourceCodeStart":68,"sourceCodeEnd":89,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/langchain/src/transport.ts#L68-L89","documentation":"The LangChain transport adapter used by the AI SDK does not implement reconnectToStream; it unconditionally throws 'Method not implemented.' Reconnecting to a previously started stream is not supported for this transport, so calling it always fails by design rather than by bug.","triggerScenarios":"Invoking reconnectToStream on a ChatTransport created from the LangChain adapter — typically after a page reload or dropped connection when trying to resume an ongoing chat stream.","commonSituations":"Using useChat's resume/reconnect feature with a LangChain-backed transport, or frameworks that call reconnectToStream automatically to restore interrupted conversations.","solutions":["Do not call reconnectToStream with the LangChain transport; start a new request instead","Persist messages yourself and re-send history as a new chat request after reload","Wrap the call defensively and fall back to a fresh send when it throws","Check for newer versions of @ai-sdk/langchain — reconnect support may have been added"],"exampleFix":"// before\nconst stream = await transport.reconnectToStream({ chatId });\n// after\nlet stream = null;\ntry { stream = await transport.reconnectToStream({ chatId }); }\ncatch { stream = await transport.sendMessages({ chatId, messages: savedMessages }); }","handlingStrategy":"fallback","validationCode":"// detect unsupported reconnect capability before calling\nif (!(transport as any).reconnectSupported) {\n  // skip reconnect path entirely\n}","typeGuard":"function supportsReconnect(t: unknown): boolean {\n  // LangChain transport always throws; treat reconnect as unsupported\n  return t instanceof ChatTransport && !(t instanceof LangChainTransport);\n}","tryCatchPattern":"let stream: ReadableStream<UIMessageChunk> | null = null;\ntry {\n  stream = await transport.reconnectToStream({ chatId });\n} catch {\n  stream = await transport.sendMessages({ chatId, messages: savedMessages });\n}","preventionTips":["Never rely on reconnect with the LangChain transport — persist messages and resend","Feature-detect or document transport capabilities in your app","Keep an eye on @ai-sdk/langchain releases for reconnect support","Guard resume flows (e.g. after page reload) with try/catch plus a fresh-send fallback"],"tags":["not-implemented","streaming","langchain"],"backgroundTag":"method-not-implemented","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}