UNPKG

ai

Version:

AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.

25 lines (16 loc) 623 B
--- title: TypeScript error "Cannot find namespace 'JSX'" description: Troubleshooting errors related to TypeScript and JSX. --- # TypeScript error "Cannot find namespace 'JSX'" ## Issue I am using the AI SDK in a project without React, e.g. an Hono server, and I get the following error: `error TS2503: Cannot find namespace 'JSX'.` ## Background The AI SDK has a dependency on `@types/react` which defines the `JSX` namespace. It will be removed in the next major version of the AI SDK. ## Solution You can install the `@types/react` package as a dependency to fix the error. ```bash npm install @types/react ```