
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis is a common dependency compatibility issue between @sanity/client and its underlying get-it package when using older versions of Next.js. Based on a resolved case in the Sanity community, the solution involves upgrading your Next.js version.
The error 'retry' is not exported from 'get-it/middleware' happens because older Next.js versions (particularly Next.js 13) have fallen out of compatibility with current Sanity packages. The get-it package that powers @sanity/client has evolved its module exports in ways that older bundlers don't handle correctly.
Here's the step-by-step fix:
Remove existing dependencies to start fresh:
rm -rf node_modules package-lock.jsonUpgrade these key packages to their latest versions:
{
"dependencies": {
"next": "latest",
"next-sanity": "latest",
"@sanity/client": "latest"
}
}If you have peer dependency conflicts (common with styled-components):
npm install --legacy-peer-depsTest both development and production builds:
npm run dev
npm run buildIf you can't upgrade immediately, try these:
Force Vite to re-bundle:
npm run dev -- --forceOr clear cache completely:
rm -rf node_modules
npm install --legacy-peer-depsInvalid Version: 6.1 during npm install, check for malformed version strings in your dependenciesindex.browser.js because it's happening during browser bundle compilationnpm-force-resolutions, remove it from your package.json—modern npm versions handle resolutions differentlyThe upgrade to Next.js 14 or later is the most reliable long-term solution. Sanity's current packages are built and tested against modern Next.js versions, ensuring proper bundling and module resolution.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store