Sanity client Promise.prototype.then error on incompatible receiver

12 replies
Last updated: Nov 29, 2025
I get the following error: Uncaught TypeError: Method Promise.prototype.then called on incompatible receiver #<Promise> at Proxy.then (<anonymous>)

I ask here because my chrome console says the error comes from client.js (where I create the client). Been trying to fix this for a while and it's becoming quite annoying, help would be really appreciated.
AI Update

This is a tricky error that can be frustrating to debug! The Promise.prototype.then called on incompatible receiver error typically happens when there's a mismatch in how promises are being handled, often related to how the Sanity client is imported or configured.

Based on similar issues in the community, here are the most common causes and solutions:

Most Likely Causes

1. Client Import/Export Issue

Make sure you're exporting and importing your Sanity client correctly. Your client.js file should look like this:

import { createClient } from '@sanity/client'

export const client = createClient({
  projectId: 'your-project-id',
  dataset: 'production',
  useCdn: true,
  apiVersion: '2023-05-03',
})

Then import it with:

import { client } from './path/to/client'

2. Mixing Promise Patterns

Since you're using Next.js 13 with async/await (which is correct), make sure you're not accidentally chaining .then() anywhere in your code. Your fetch pattern looks correct:

const projects = await client.fetch(`*[_type == "project"]`)

3. Build Cache Issues

This error sometimes resolves after rebuilding the project. Try:

# Delete build artifacts
rm -rf .next
rm -rf node_modules/.cache

# Reinstall and rebuild
npm install
npm run dev

4. Multiple Client Instances

Check if you're accidentally creating multiple client instances or if there's a conflict with how the client is being proxied. Make sure you're only creating one client instance and reusing it throughout your app.

5. Next.js 13 App Router Specifics

If you're using the App Router, ensure your component is properly marked as async and you're not mixing server/client components incorrectly. Server components (the default) should use async/await directly, while client components need 'use client' at the top.

Additional Debugging Steps

  • Check your browser's Network tab to see if the Sanity API requests are actually succeeding
  • Look for any other promise-related code in your files that might be interfering
  • Make sure your @sanity/client package is up to date: npm install @sanity/client@latest
  • Verify you don't have conflicting versions of the Sanity client installed
  • Try temporarily simplifying your queries to just one fetch to isolate the issue

The error pointing to client.js in Chrome's console can sometimes be misleading - the actual issue might be in how the client is being used elsewhere in your code, not in the client configuration itself.

If the problem persists after trying these solutions, I'd recommend sharing your exact client.js configuration and how you're importing/using it in your page component on the Sanity community Discord where folks can help debug further with more context.

Show original thread
12 replies

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?