AI SDK
  • Docs
  • Cookbook
  • Providers
  • Showcase
  • Playground

AI SDK 4.2 is now available!

Read Announcement
AI SDK by Vercel
Foundations
Overview
Providers and Models
Prompts
Tools
Streaming
Agents
Getting Started
Navigating the Library
Next.js App Router
Next.js Pages Router
Svelte
Vue.js (Nuxt)
Node.js
Expo
Guides
RAG Chatbot
Multi-Modal Chatbot
Slackbot Guide
Natural Language Postgres
Get started with Computer Use
OpenAI Responses API
Get started with Claude 3.7 Sonnet
Get started with Llama 3.1
Get started with OpenAI GPT-4.5
Get started with OpenAI o1
Get started with OpenAI o3-mini
Get started with DeepSeek R1
AI SDK Core
Overview
Generating Text
Generating Structured Data
Tool Calling
Prompt Engineering
Settings
Embeddings
Image Generation
Transcription
Speech
Language Model Middleware
Provider & Model Management
Error Handling
Testing
Telemetry
AI SDK UI
Overview
Chatbot
Chatbot Message Persistence
Chatbot Tool Usage
Generative User Interfaces
Completion
Object Generation
OpenAI Assistants
Streaming Custom Data
Error Handling
Smooth streaming japanese text
Smooth streaming chinese text
Stream Protocols
AI SDK RSC
Advanced
Reference
AI SDK Core
AI SDK UI
AI SDK RSC
Stream Helpers
AI SDK Errors
AI_APICallError
AI_DownloadError
AI_EmptyResponseBodyError
AI_InvalidArgumentError
AI_InvalidDataContentError
AI_InvalidDataContent
AI_InvalidMessageRoleError
AI_InvalidPromptError
AI_InvalidResponseDataError
AI_InvalidToolArgumentsError
AI_JSONParseError
AI_LoadAPIKeyError
AI_LoadSettingError
AI_MessageConversionError
AI_NoAudioGeneratedError
AI_NoContentGeneratedError
AI_NoImageGeneratedError
AI_NoObjectGeneratedError
AI_NoOutputSpecifiedError
AI_NoSuchModelError
AI_NoSuchProviderError
AI_NoSuchToolError
AI_NoTranscriptGeneratedError
AI_RetryError
AI_TooManyEmbeddingValuesForCallError
ToolCallRepairError
AI_ToolExecutionError
AI_TypeValidationError
AI_UnsupportedFunctionalityError
Migration Guides
Troubleshooting
AI SDK ErrorsAI_JSONParseError

AI_JSONParseError

This error occurs when JSON fails to parse.

Properties

  • text: The text value that could not be parsed
  • message: The error message including parse error details

Checking for this Error

You can check if an error is an instance of AI_JSONParseError using:

import { JSONParseError } from 'ai';
if (JSONParseError.isInstance(error)) {
// Handle the error
}
Previous
AI_InvalidToolArgumentsError
Next
AI_LoadAPIKeyError
On this page
AI_JSONParseError
Properties
Checking for this Error
Elevate your AI applications with Vercel.
Trusted by OpenAI, Replicate, Suno, Pinecone, and more.
Vercel provides tools and infrastructure to deploy AI apps and features at scale.

Resources

DocsCookbookProvidersShowcaseGitHubDiscussions

More

PlaygroundContact Sales

About Vercel

Next.js + VercelOpen Source SoftwareGitHubX

Legal

Privacy Policy

© 2025 Vercel, Inc.