I'm getting this error again and again. I've provided projectID as well via env file, still getting I'm new to NextJS and sanity as well, please help me out, your help will be appreciated.
import sanityClient from '@sanity/client'; import imageUrlBuilder from '@sanity/image-url';
export const client = sanityClient({ projectId: process.env.NEXT_APP_PROJECT_ID, dataset: 'production', apiVersion: '2022-03-10', useCdn: true, token: process.env.NEXT_APP_SANITY_TOKEN });
const builder = imageUrlBuilder(client);
export const urlFor = (source) => builder.image(source);
I'm following a tutorial on NextJS tutorial on youtube. I was expecting it to be run smoothly, but didn't work