TanStack AI version
@tanstack/ai@0.20.1, @tanstack/ai-react@0.11.3
Framework/Library version
React 19.2.0, TypeScript 5.9.3
Describe the bug and the steps to reproduce it
Title: @standard-schema/spec missing from dependencies — breaks type-checked linting (e.g. @typescript-eslint)
TanStack AI version: @tanstack/ai@0.20.1, @tanstack/ai-react@0.11.3
Framework/Library version: React 19.2.0, TypeScript 5.9.3
Describe the bug and the steps to reproduce it:
@tanstack/ai@0.20.1 publishes .d.ts files that import from @standard-schema/spec:
dist/esm/types.d.ts
dist/esm/activities/chat/tools/tool-definition.d.ts
dist/esm/activities/chat/tools/schema-converter.d.ts
However, @standard-schema/spec is only listed in devDependencies, not dependencies or peerDependencies. This means consumers don't have it installed.
With skipLibCheck: true (the common default), tsc silently ignores the unresolved import inside .d.ts files. But type-aware tools like @typescript-eslint (with recommendedTypeChecked / projectService: true) follow the full type chain to resolve return types. When it hits the missing module, the entire type resolution for useChat() fails, producing an "error type" that cascades through all usages.
Steps to reproduce:
pnpm add @tanstack/ai-react @tanstack/ai
- Use
useChat in a component:
import { useChat, fetchServerSentEvents } from '@tanstack/ai-react'
const { messages, sendMessage, isLoading } = useChat({
connection: fetchServerSentEvents('/api/chat'),
})
- Run ESLint with
typescript-eslint@8.x using recommendedTypeChecked and projectService: true
- Observe:
Unsafe assignment of an error typed value on the useChat destructuring
Expected behavior: Types resolve without requiring the consumer to manually install @standard-schema/spec.
Workaround: pnpm add -D @standard-schema/spec
Suggested fix: Move @standard-schema/spec to peerDependencies (with optional: true if desired) or dependencies in @tanstack/ai's package.json, since it's referenced in published type declarations.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
This is an ESLint type-resolution issue that requires running npx eslint locally — not reproducible in browser sandboxes.
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
No, because I do not have time to dig into it
Terms & Code of Conduct
TanStack AI version
@tanstack/ai@0.20.1,@tanstack/ai-react@0.11.3Framework/Library version
React 19.2.0, TypeScript 5.9.3
Describe the bug and the steps to reproduce it
Title:
@standard-schema/specmissing from dependencies — breaks type-checked linting (e.g.@typescript-eslint)TanStack AI version:
@tanstack/ai@0.20.1,@tanstack/ai-react@0.11.3Framework/Library version: React 19.2.0, TypeScript 5.9.3
Describe the bug and the steps to reproduce it:
@tanstack/ai@0.20.1publishes.d.tsfiles that import from@standard-schema/spec:dist/esm/types.d.tsdist/esm/activities/chat/tools/tool-definition.d.tsdist/esm/activities/chat/tools/schema-converter.d.tsHowever,
@standard-schema/specis only listed indevDependencies, notdependenciesorpeerDependencies. This means consumers don't have it installed.With
skipLibCheck: true(the common default),tscsilently ignores the unresolved import inside.d.tsfiles. But type-aware tools like@typescript-eslint(withrecommendedTypeChecked/projectService: true) follow the full type chain to resolve return types. When it hits the missing module, the entire type resolution foruseChat()fails, producing an "error type" that cascades through all usages.Steps to reproduce:
pnpm add @tanstack/ai-react @tanstack/aiuseChatin a component:typescript-eslint@8.xusingrecommendedTypeCheckedandprojectService: trueUnsafe assignment of an error typed valueon theuseChatdestructuringExpected behavior: Types resolve without requiring the consumer to manually install
@standard-schema/spec.Workaround:
pnpm add -D @standard-schema/specSuggested fix: Move
@standard-schema/spectopeerDependencies(withoptional: trueif desired) ordependenciesin@tanstack/ai's package.json, since it's referenced in published type declarations.Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
This is an ESLint type-resolution issue that requires running npx eslint locally — not reproducible in browser sandboxes.
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
No, because I do not have time to dig into it
Terms & Code of Conduct