2

I've just finished working on a project using Next.js 13 and Sanity as a headless CMS. Here is the issue I'm experiencing:

When I run

vercel build

I get the error that 'sanity' has no exported member 'defineConfig' and this is coming from the sanity.config.ts file.

I am using Sanity Studio v3 and have setup sanity in my project using

npm create sanity@latest

enter image description here

This is what I've tried. I uninstalled sanity and reinstalled the latest version but that didn't work. Further probing lead me to this gist, so I removed 'deineConfig' import and also as the outer wrapper for the Sanity studio config but that resulted in other errors elsewhere. Specifically, 'sanity' says it has no exported members 'defineType' and 'defineField'.

Moritz Ringler
  • 9,772
  • 9
  • 21
  • 34
Olowoseun
  • 21
  • 1

1 Answers1

2

please try

import {defineField, defineType} from 'sanity/lib/exports'
import {defineConfig} from 'sanity/lib/exports'
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103