I am trying to make nextjs typescript project using sanity.io but im not able to solve this problem. itis showing that createImageUrlBuilder is not a function.
createImageUrlBuilder
is no longer wrapped by next-sanity
and you'll need to install the dependency yourself (https://github.com/sanity-io/next-sanity#createimageurlbuilder-is-removed)
$ npm install @sanity/image-url
// or
$ yarn add @sanity/image-url
Notice also that createImageUrlBuilder
is now a default import.
-import { createImageUrlBuilder } from 'next-sanity'
+import createImageUrlBuilder from '@sanity/image-url'